<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<!-- Content Header (Page header) -->
<section class="content-header" style="">
    <h1>
        商户管理
        <small>设备管理页面</small>
    </h1>
    <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> 主页</a></li>
        <li><a href="#">商户管理</a></li>
        <li class="active">设备管理页面</li>
    </ol>
</section>

<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <!-- /.box-header -->
                <div class="box-body">
                    <div id="toolbar">
                        <form class="form-inline" id="searchForm">
                            <div class="form-group">
                                <label for="searchposName"> 设备名称</label>
                                <input type="text" class="form-control input-sm" name="posName" id="searchposName" placeholder="请输入用户名">
                            </div>
                            <div class="form-group">
                                <label for="searchcompanyName">
                                    公司名称</label>
                                <input type="text" class="form-control input-sm" name="companyName" id="searchcompanyName" placeholder="商户名称">
                            </div>
                            <div class="btn-group btn-group-sm">
                                <button type="button" class="btn btn-default" onclick="javascript:$('table').bootstrapTable('refresh', {silent: true});">
                                    <i class="glyphicon glyphicon-search"></i>
                                    查询
                                </button>
                                <button type="reset" class="btn btn-default">
                                    <i class="glyphicon glyphicon-trash"></i>
                                    清空
                                </button>
                            </div>
                        </form>
                        <div class="btn-group btn-group-sm">
                            <!-- Provides extra visual weight and identifies the primary action in a set of buttons -->
                            <button onclick="yin()" shiro:hasPermission="pos:create" type="button" id="addBtn" class="btn btn-default"
                                    data-toggle="modal"
                                    data-target="#addModal"><i class="glyphicon glyphicon-plus"></i> 新增
                            </button>
                            <!-- Indicates caution should be taken with this action -->
                            <button shiro:hasPermission="pos:update" type="button" id="editBtn" class="btn btn-default"
                                    data-toggle="modal"
                                    data-target="#editModal"
                                    data-action="{type:'editable',form:'#editForm',table:'#table',after:'editAfter'}"
                                    disabled><i class="glyphicon glyphicon-edit"></i> 修改
                            </button>
                            <!-- Indicates a dangerous or potentially negative action -->
                            <button shiro:hasPermission="pos:delete" type="button" id="deleteBtn" class="btn btn-default" data-toggle="modal"
                                    data-target="#deleteModal"
                                    data-action="{type:'delete',form:'#deleteForm',idField:'id',table:'#table'}"
                                    disabled><i class="glyphicon glyphicon-remove"></i> 删除
                            </button>
                            <button  shiro:hasPermission="pos:create" type="button" id="daoBtn" class="btn btn-default"
                                    data-toggle="modal"
                                    data-target="#daoModal"><i class="glyphicon glyphicon-plus"></i> 导入
                            </button>
                        </div>
                    </div>
                    <table id="table"></table>
                </div>
                <!-- /.box-body -->
            </div>
            <!-- /.box -->

        </div>
        <!-- /.col -->
    </div>
    <!-- /.row -->
</section>
<!-- /.content -->

<!-- add Modal -->
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="addModalLabel">添加设备</h4>
            </div>
            <div class="modal-body">
                <form id="addForm">
                    <div class="form-group">
                        <input type="hidden" id="companyName" name="companyName">
                        <label class="control-label" for="companyId"><span class="asterisk">*</span>商户:</label>
                        <select name="companyId" id="companyId" class="form-control"
                                data-placeholder="请从列表选择一项" required>
                            <option value="">请选择用户</option>
                            <option th:each="company : ${companyList}" th:value="${company.companyId}" th:text="${company.companyName}">
                                商户不存在
                            </option>
                        </select>
                        <div class="help-block with-errors"></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="posNo"><span class="asterisk">*</span>pos编号:</label>
                        <input id="posNo" type="text" oninput = "value=value.replace(/[^\d]/g,'')" class="form-control" name="posNo" placeholder="请输入pos编号"
                               minlength="3" required>
                        <div class="help-block with-errors"></div>
                    </div>

                    <input type="hidden" id="payChannel" name="payChannel">
                    <div class="form-group" id="ZFQD">
                        <label class="control-label" for="type"><span class="asterisk">*</span>支付渠道:</label>
                        <select name="type" id="type" multiple class="form-control select2"
                                data-placeholder="请从列表选择一项" required>
                            <option th:each="type : ${types}" th:value="${type}" th:text="${type.info}">
                                支付渠道
                            </option>
                        </select>
                        <div class="help-block with-errors"></div>
                    </div>

                    <div class="form-group">
                        <label class="control-label" for="posName"><span class="asterisk">*</span>设备名称:</label>
                        <input id="posName" type="text" class="form-control" name="posName" placeholder="请输入设备名称"
                               minlength="3" required>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="posType"><span class="asterisk">*</span>设备类型:</label>
                        <select class="form-control" name="posType" id="posType">
                            <option th:each="postype : ${postypes}" th:value="${postype.infoId}" th:text="${postype.info}">设备类型不存在</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="posRemark">设备备注:</label>
                        <input id="posRemark" type="text" class="form-control" name="posRemark" placeholder="请输入设备备注"
                               minlength="1">
                        <div class="help-block with-errors"></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="expendMoney"><span class="asterisk">*</span>消费金额:</label>
                        <input id="expendMoney" oninput="num(this)"  type="text" class="form-control" name="expendMoney" placeholder="请输入消费金额"
                               minlength="1" required>
                        <div class="help-block with-errors"></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="ipAddress">ip地址:</label>
                        <input id="ipAddress" type="text" class="form-control" name="ipAddress" placeholder="请输入ip地址"
                               minlength="3" oninput="this.value=this.value.replace(/[^0-9\.]/g,'')">
                        <div class="help-block with-errors"></div>
                    </div>
                    <div id="WX">
                        <hr/>
                        <h4 class="modal-title" id="wxzf">微信支付</h4>
                        <input type="hidden"  id="wxIsCallback">
                        <input type="hidden"  id="payType">
                        <div class="form-group">
                            <label class="control-label" for="paytype1"><span class="asterisk">*</span>支付类型:</label>
                            <select id="paytype1" multiple class="form-control select2">
                                <option th:each="paytype : ${paytypes}" th:value="${paytype}" th:text="${paytype.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" ><span class="asterisk">*</span>需要子商户:</label>
                            需要<input type="radio"  name="wxIsEvery" id="wxXiuyaoZiShangHu" value="1" onclick="wxIsZiShangHu()">
                            不需要<input type="radio" name="wxIsEvery" id="wxBuxiuyaoZiShangHu" value="0" onclick="wxIsbuZiShangHu()" checked>
                            <div class="help-block with-errors" ></div>
                        </div>
                        <div class="form-group" id="wxZiAppID" style="display:none">
                            <label class="control-label" for="WXChildAppID"><span class="asterisk">*</span>子商户AppID:</label>
                            <input id="WXChildAppID" type="text" class="form-control"  placeholder="输入子商户AppID">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="appID"><span class="asterisk">*</span>AppID:</label>
                            <input id="appID" type="text" class="form-control"  placeholder="输入AppID">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="mchid"><span class="asterisk">*</span>Mchid:</label>
                            <input id="mchid" type="text" class="form-control"  placeholder="输入Mchid">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="key"><span class="asterisk">*</span>Key:</label>
                            <input id="key" type="text" class="form-control" placeholder="输入Key">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editunionpaytype"><span class="asterisk">*</span>选择导入的文件:</label>
                            <input type="file" id="upload-file" />
                            <a id="start-upload" href="javascript:void(0);" onclick="uploadFile(0);">开始上传</a>
                        </div>
                        <div class="form-group" id="wxCallbacks" style="display:none">
                            <label class="control-label" for="WXCallback"><span class="asterisk">*</span>回调地址:</label>
                            <input id="WXCallback" type="text" class="form-control" placeholder="输入回调地址">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="remark">备注:</label>
                            <input id="remark" type="text" class="form-control" placeholder="输入备注">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="ZF">
                        <hr/>
                        <h4 class="modal-title" id="zfb">支付宝支付</h4>

                        <input type="hidden"  id="payType2">
                        <div class="form-group">
                            <label class="control-label" for="zpaytype"><span class="asterisk">*</span>支付类型:</label>
                            <select id="zpaytype" multiple class="form-control select2"
                            >
                                <option th:each="zpaytype : ${paytypes}" th:value="${zpaytype}" th:text="${zpaytype.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <div class="form-group">
                            <label class="control-label" for="pid"><span class="asterisk">*</span>Pid:</label>
                            <textarea id="pid" class="form-control" cols="50" rows="3" placeholder="输入Pid"></textarea>
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="appID1"><span class="asterisk">*</span>Appid:</label>
                            <textarea id="appID1" class="form-control" cols="50" rows="3" placeholder="输入Appid"></textarea>
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="privateKey"><span class="asterisk">*</span>Privatekey:</label>
                            <textarea id="privateKey" class="form-control" cols="50" rows="3" placeholder="输入Privatekey"></textarea>
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="publicKey"><span class="asterisk">*</span>Publickey:</label>
                            <input id="publicKey"  class="form-control" name="publicKey" placeholder="输入Publickey">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="alipayPublicKey"><span class="asterisk">*</span>AlipayPublicKey:</label>
                            <input id="alipayPublicKey" type="text" class="form-control" placeholder="输入AlipayPublicKey">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="remark1">备注:</label>
                            <input id="remark1" type="text" class="form-control"  placeholder="输入备注">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="UNION">
                        <hr/>
                        <h4 class="modal-title" id="unionpay">银联支付</h4>

                        <input type="hidden"  id="payType4">
                        <div class="form-group">
                            <label class="control-label" for="unionpaytype"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="unionpaytype" multiple class="form-control select2">
                                <option th:each="unionpaytype : ${paytypes}" th:value="${unionpaytype}" th:text="${unionpaytype.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <div class="form-group">
                            <label class="control-label" for="mchid1"><span class="asterisk">*</span>Mchid:</label>
                            <input id="mchid1" type="text" class="form-control"  placeholder="输入Mchid">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="key1"><span class="asterisk">*</span>Key:</label>
                            <input id="key1" type="text" class="form-control" placeholder="输入Key">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group" id="unionCallbacks" style="display:none">
                            <label class="control-label" for="unionCallback"><span class="asterisk">*</span>回调地址:</label>
                            <input id="unionCallback" type="text" class="form-control" placeholder="输入回调地址">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="remark3">备注:</label>
                            <input id="remark3" type="text" class="form-control" placeholder="输入备注">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="ICBC">
                        <hr/>
                        <h4 class="modal-title" id="icbcpay">工行聚合支付</h4>

                        <input type="hidden"  id="icbcPayType">
                        <div class="form-group">
                            <label class="control-label" for="icbcPayTypeselect"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="icbcPayTypeselect" multiple class="form-control select2">
                                <option th:each="icbcpaytype : ${paytypes}" th:value="${icbcpaytype.payType}" th:text="${icbcpaytype.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <!--<div class="form-group">
                            <label class="control-label" for="icbcMchid"><span class="asterisk">*</span>Mchid:</label>
                            <input id="icbcMchid" type="text" class="form-control"  placeholder="输入Mchid">
                            <div class="help-block with-errors"></div>
                        </div>-->
                        <div class="form-group">
                            <label class="control-label" for="icbcAppId"><span class="asterisk">*</span>AppId:</label>
                            <input id="icbcAppId" type="text" class="form-control" placeholder="输入AppId">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="icbcPrivateKey"><span class="asterisk">*</span>Privatekey:</label>
                            <textarea id="icbcPrivateKey" class="form-control" cols="50" rows="3" placeholder="输入Privatekey"></textarea>
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="icbcPublicKey"><span class="asterisk">*</span>PublicKey:</label>
                            <textarea id="icbcPublicKey" class="form-control" cols="50" rows="3" placeholder="输入PublicKey"></textarea>
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="icbcRemark">备注:</label>
                            <input id="icbcRemark" type="text" class="form-control" placeholder="输入备注">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="QDNS">
                        <hr/>
                        <h4 class="modal-title" id="qingDaoNongShang">青岛农商</h4>

                        <input type="hidden"  id="payType5">
                        <div class="form-group">
                            <label class="control-label" for="qingDaoNongShangtype"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="qingDaoNongShangtype" multiple class="form-control select2">
                                <option th:each="qingDaoNongShangtype : ${paytypes}" th:value="${qingDaoNongShangtype}" th:text="${qingDaoNongShangtype.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <div class="form-group">
                            <label class="control-label" for="commid"><span class="asterisk">*</span>商户标识:</label>
                            <input id="commid" type="text" class="form-control"  placeholder="输入商户标识">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="commoperid"><span class="asterisk">*</span>商户操作员编号:</label>
                            <input id="commoperid" type="text" class="form-control" placeholder="输入商户操作员编号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="commstoreno"><span class="asterisk">*</span>商户门店编号:</label>
                            <input id="commstoreno" type="text" class="form-control" placeholder="输入商户门店编号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="devsn"><span class="asterisk">*</span>机器终端编号:</label>
                            <input id="devsn" type="text" class="form-control" placeholder="输入机器终端编号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="qingDaoNongShangkey"><span class="asterisk">*</span>商户秘钥:</label>
                            <input id="qingDaoNongShangkey" type="text" class="form-control" placeholder="输入商户秘钥">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="remark4">备注:</label>
                            <input id="remark4" type="text" class="form-control" placeholder="输入备注">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="ShouQianBa">
                        <hr/>
                        <h4 class="modal-title" id="ShouQianBaTi">收钱吧</h4>

                        <input type="hidden"  id="ShouQianBaPayTypes">
                        <div class="form-group">
                            <label class="control-label" for="ShouQianBaPayType"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="ShouQianBaPayType" multiple class="form-control select2">
                                <option th:each="ShouQianBaPaytype : ${paytypes}" th:value="${ShouQianBaPaytype}" th:text="${ShouQianBaPaytype.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <div class="form-group">
                            <label class="control-label" for="terminal_sn"><span class="asterisk">*</span>终端号:</label>
                            <input id="terminal_sn" type="text" class="form-control"  placeholder="输入终端号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="terminal_key"><span class="asterisk">*</span>终端密钥:</label>
                            <input id="terminal_key" type="text" class="form-control" placeholder="输入终端密钥">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="remark5">备注:</label>
                            <input id="remark5" type="text" class="form-control" placeholder="输入备注">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="ccbb">
                        <hr/>
                        <h4 class="modal-title" id="ccbbpay">龙支付</h4>

                        <input type="hidden"  id="ccbbChecked">

                        <input type="hidden"  id="ccbbPayTypes">
                        <div class="form-group">
                            <label class="control-label" for="ccbbPayType"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="ccbbPayType" multiple class="form-control select2">
                                <option th:each="ccbbPayType : ${paytypes}" th:value="${ccbbPayType}" th:text="${ccbbPayType.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="ccbbPayType">聚合支付:</label>
                            <input type="checkbox" onclick="checkboxOnclick(this)"/>
                            <label class="control-label" for="ccbbPayType">人民币数字支付:</label>
                            <input type="checkbox" onclick="checkboxTwoclick(this)"/>
                            <label class="control-label" for="ccbbPayType">云闪付:</label>
                            <input type="checkbox" onclick="checkboxThreeclick(this)"/>
                        </div>
                        <div id="aggregation">
                            <div class="form-group">
                                <label class="control-label" for="MERCHANTID"><span class="asterisk">*</span>聚合支付的商户号:</label>
                                <input id="MERCHANTID" type="text" class="form-control"  placeholder="输入商户号">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="POSID"><span class="asterisk">*</span>聚合支付的柜台号:</label>
                                <input id="POSID" type="text" class="form-control" placeholder="输入柜台号">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="BRANCHID"><span class="asterisk">*</span>聚合支付的分行号:</label>
                                <input id="BRANCHID" type="text" class="form-control" placeholder="输入柜台号">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="ccbbPubKey"><span class="asterisk">*</span>聚合支付的公钥:</label>
                                <input id="ccbbPubKey" type="text" class="form-control" placeholder="输入公钥">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="USERID"><span class="asterisk">*</span>操作员号:</label>
                                <input id="USERID" type="text" class="form-control" placeholder="输入操作员号">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="ccbbPASSWORD"><span class="asterisk">*</span>密码:</label>
                                <input id="ccbbPASSWORD" type="text" class="form-control" placeholder="输入密码">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="port"><span class="asterisk">*</span>端口号:</label>
                                <input id="port" type="text" class="form-control" placeholder="输入端口号">
                                <div class="help-block with-errors"></div>
                            </div>
                        </div>
                        <div id="DC">
                            <div class="form-group">
                                <label class="control-label" for="DCMERCHANTID"><span class="asterisk">*</span>人民币数字的商户号:</label>
                                <input id="DCMERCHANTID" type="text" class="form-control"  placeholder="输入商户号">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="DCPOSID"><span class="asterisk">*</span>人民币数字的柜台号:</label>
                                <input id="DCPOSID" type="text" class="form-control" placeholder="输入柜台号">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="DCBRANCHID"><span class="asterisk">*</span>人民币数字的分行号:</label>
                                <input id="DCBRANCHID" type="text" class="form-control" placeholder="输入分行号">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="ccbbDCPubKey"><span class="asterisk">*</span>人民币数字的公钥:</label>
                                <input id="ccbbDCPubKey" type="text" class="form-control" placeholder="输入公钥">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="DCpubKey1"><span class="asterisk">*</span>瓦片公钥(PUBKEY1):</label>
                                <input id="DCpubKey1" type="text" class="form-control" placeholder="输入瓦片公钥(PUBKEY1)">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="DCpriKey1"><span class="asterisk">*</span>瓦片私钥(PRIBKEY1):</label>
                                <input id="DCpriKey1" type="text" class="form-control" placeholder="输入瓦片私钥(PRIBKEY1)">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="DCpubKey2"><span class="asterisk">*</span>瓦片平台关联密钥对(PUBKEY2):</label>
                                <input id="DCpubKey2" type="text" class="form-control" placeholder="输入瓦片平台关联密钥对(PUBKEY2)">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="DCFTCORPID"><span class="asterisk">*</span>瓦片调用方ID:</label>
                                <input id="DCFTCORPID" type="text" class="form-control" placeholder="输入瓦片调用方ID">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="DCUSERID"><span class="asterisk">*</span>人民币数字的操作员号:</label>
                                <input id="DCUSERID" type="text" class="form-control" placeholder="输入人民币数字的操作员号">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="DCPASSWORD"><span class="asterisk">*</span>人民币数字的操作员密码:</label>
                                <input id="DCPASSWORD" type="text" class="form-control" placeholder="输入人民币数字的操作员密码">
                                <div class="help-block with-errors"></div>
                            </div>
                        </div>
                        <div id="UNIONPAYPS">
                            <div class="form-group">
                                <label class="control-label" for="appidUNIONPAYPS"><span class="asterisk">*</span>appid:</label>
                                <input id="appidUNIONPAYPS" type="text" class="form-control"  placeholder="输入appid">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="appkeyUNIONPAYPS"><span class="asterisk">*</span>appkey:</label>
                                <input id="appkeyUNIONPAYPS" type="text" class="form-control"  placeholder="输入appkey">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="merchantCodeUNIONPAYPS"><span class="asterisk">*</span>商户号:</label>
                                <input id="merchantCodeUNIONPAYPS" type="text" class="form-control"  placeholder="输入商户号">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="terminalCodeUNIONPAYPS"><span class="asterisk">*</span>终端号:</label>
                                <input id="terminalCodeUNIONPAYPS" type="text" class="form-control"  placeholder="输入终端号">
                                <div class="help-block with-errors"></div>
                            </div>
                        </div>
                        <div class="form-group" id="ccbbCallbacks" style="display:none">
                            <label class="control-label" for="ccbbAPPID"><span class="asterisk">*</span>APPID:</label>
                            <input id="ccbbAPPID" type="text" class="form-control" placeholder="输入APPID">
                            <div class="help-block with-errors"></div>
                            <label class="control-label" for="ccbbCallback"><span class="asterisk">*</span>回调地址:</label>
                            <input id="ccbbCallback" type="text" class="form-control" placeholder="输入回调地址">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="ccbbremark">备注:</label>
                            <input id="ccbbremark" type="text" class="form-control" placeholder="输入备注">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="kancloud">
                        <hr/>
                        <h4 class="modal-title" id="kancloudpay">移领支付</h4>

                        <input type="hidden"  id="kancloudTypes">
                        <div class="form-group">
                            <label class="control-label" for="kancloudType"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="kancloudType" multiple class="form-control select2">
                                <option th:each="kancloudType : ${paytypes}" th:value="${kancloudType}" th:text="${kancloudType.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <div class="form-group">
                            <label class="control-label" for="merchantNum"><span class="asterisk">*</span>门店编号:</label>
                            <input id="merchantNum" type="text" class="form-control"  placeholder="输入门店编号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="kancloudKey"><span class="asterisk">*</span>交易密钥:</label>
                            <input id="kancloudKey" type="text" class="form-control" placeholder="输入交易密钥">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="kancloudRemark">备注:</label>
                            <input id="kancloudRemark" type="text" class="form-control" placeholder="输入备注">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="leshua">
                        <hr/>
                        <h4 class="modal-title" id="leshuas">乐刷支付</h4>

                        <input type="hidden"  id="leshuaTypes">
                        <div class="form-group">
                            <label class="control-label" for="leshuaType"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="leshuaType" multiple class="form-control select2">
                                <option th:each="leshuaType : ${paytypes}" th:value="${leshuaType}" th:text="${leshuaType.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <div class="form-group">
                            <label class="control-label" for="leshuamerchantId"><span class="asterisk">*</span>商户号:</label>
                            <input id="leshuamerchantId" type="text" class="form-control"  placeholder="输入商户号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="leshuaKey"><span class="asterisk">*</span>交易密钥:</label>
                            <input id="leshuaKey" type="text" class="form-control" placeholder="输入交易密钥">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="leshuaRemark">备注:</label>
                            <input id="leshuaRemark" type="text" class="form-control" placeholder="输入备注">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="chinaums">
                        <hr/>
                        <h4 class="modal-title" id="chinaumss">大华捷通</h4>

                        <input type="hidden"  id="chinaumsIsCallback">
                        <input type="hidden"  id="chinaumsTypes">
                        <div class="form-group">
                            <label class="control-label" for="chinaumsType"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="chinaumsType" multiple class="form-control select2">
                                <option th:each="chinaumsType : ${paytypes}" th:value="${chinaumsType}" th:text="${chinaumsType.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <div class="form-group">
                            <label class="control-label" for="chinaumsmerchantId"><span class="asterisk">*</span>商户号:</label>
                            <input id="chinaumsmerchantId" type="text" class="form-control"  placeholder="输入商户号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="chinaumsKey"><span class="asterisk">*</span>秘钥:</label>
                            <input id="chinaumsKey" type="text" class="form-control" placeholder="输入秘钥">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="chinaumsdevsn"><span class="asterisk">*</span>终端号:</label>
                            <input id="chinaumsdevsn" type="text" class="form-control" placeholder="输入终端号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group" id="chinaumsCallbacks" style="display:none">
                            <label class="control-label" for="chinaumsCallback"><span class="asterisk">*</span>回调地址:</label>
                            <input id="chinaumsCallback" type="text" class="form-control" placeholder="输入回调地址">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="chinaumsRemark">备注:</label>
                            <input id="chinaumsRemark" type="text" class="form-control" placeholder="输入备注">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="unionschool">
                        <hr/>
                        <h4 class="modal-title" id="UNIONSCHOLLS">银联校园版</h4>

                        <input type="hidden"  id="unionschoolIsCallback">
                        <input type="hidden"  id="unionschoolTypes">
                        <div class="form-group">
                            <label class="control-label" for="unionschoolType"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="unionschoolType" multiple class="form-control select2">
                                <option th:each="unionschoolType : ${paytypes}" th:value="${unionschoolType}" th:text="${unionschoolType.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <div class="form-group">
                            <label class="control-label" for="unionschoolBrandId"><span class="asterisk">*</span>品牌号:</label>
                            <input id="unionschoolBrandId" type="text" class="form-control"  placeholder="输入品牌号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="unionschoolOpshopId"><span class="asterisk">*</span>门店号:</label>
                            <input id="unionschoolOpshopId" type="text" class="form-control" placeholder="输入门店号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="unionschoolBussType"><span class="asterisk">*</span>业务类型:</label>
                            <input id="unionschoolBussType" type="text" class="form-control" placeholder="输入业务类型">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="unionschoolKey"><span class="asterisk">*</span>秘钥:</label>
                            <input id="unionschoolKey" type="text" class="form-control" placeholder="输入秘钥">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group" id="unionschoolCallbacks" style="display:none">
                            <label class="control-label" for="unionschoolCallback"><span class="asterisk">*</span>回调地址:</label>
                            <input id="unionschoolCallback" type="text" class="form-control" placeholder="输入回调地址">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="unionschoolRemark">备注:</label>
                            <input id="unionschoolRemark" type="text" class="form-control" placeholder="输入备注">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="ksrcb">
                        <hr/>
                        <h4 class="modal-title" id="ksrcbs">江苏昆山农商银行</h4>

                        <input type="hidden"  id="ksrcbCallback">
                        <input type="hidden"  id="ksrcbTypes">
                        <div class="form-group">
                            <label class="control-label" for="ksrcbType"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="ksrcbType" multiple class="form-control select2">
                                <option th:each="ksrcbType : ${paytypes}" th:value="${ksrcbType}" th:text="${ksrcbType.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <div class="form-group">
                            <label class="control-label" for="ksrcbSubMerNo"><span class="asterisk">*</span>子商户号:</label>
                            <input id="ksrcbSubMerNo" type="text" class="form-control"  placeholder="输入子商户号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="ksrcbSubMerName"><span class="asterisk">*</span>子商户名:</label>
                            <input id="ksrcbSubMerName" type="text" class="form-control"  placeholder="输入子商户名">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="ksrcbMerStoreNo"><span class="asterisk">*</span>商户终端标识编号:</label>
                            <input id="ksrcbMerStoreNo" type="text" class="form-control"  placeholder="输入商户终端标识编号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="ksrcbRemark">备注:</label>
                            <input id="ksrcbRemark" type="text" class="form-control" placeholder="输入备注">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button onclick="yin()" type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="submit" form="addForm" class="btn btn-primary"
                        data-action="{type:'submit',form:'#addForm',url:'@{/pos/add}',after:'$.myAction.refreshTable'}">
                    确定
                </button>
            </div>
        </div>
    </div>
</div>
<!-- edit Modal -->
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="editModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="editModalLabel">修改设备信息</h4>
            </div>
            <div class="modal-body">
                <form id="editForm">

                    <div class="form-group">
                        <input type="hidden" id="editoldpayChannel" name="oldPayChannel">
                        <input type="hidden" id="editid" name="id">
                        <input type="hidden" id="editcompanyName" name="companyName">
                        <label class="control-label" for="editcompanyId"><span class="asterisk">*</span>商户:</label>
                        <select name="companyId" id="editcompanyId" class="form-control"
                                data-placeholder="请从列表选择一项" required>
                            <option value="">请选择用户</option>
                            <option th:each="company : ${companyList}" th:value="${company.companyId}" th:text="${company.companyName}">
                                商户不存在
                            </option>
                        </select>
                        <div class="help-block with-errors"></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="editposNo"><span class="asterisk">*</span>pos编号:</label>
                        <input id="editposNo" type="text" oninput = "value=value.replace(/[^\d]/g,'')" class="form-control" name="posNo" placeholder="请输入pos编号"
                               minlength="3" required>
                        <div class="help-block with-errors"></div>
                    </div>

                    <input type="hidden" id="editpayChannel" name="payChannel">
                    <div class="form-group" id="editZFQD">
                        <label class="control-label" for="edittype"><span class="asterisk">*</span>支付渠道:</label>
                        <select name="type" id="edittype" multiple class="form-control select2"
                                data-placeholder="请从列表选择一项" required>
                            <option th:each="type : ${types}" th:value="${type.infoId}" th:text="${type.info}">
                                支付渠道
                            </option>
                        </select>
                        <div class="help-block with-errors"></div>
                    </div>

                    <div class="form-group">
                        <label class="control-label" for="posName"><span class="asterisk">*</span>设备名称:</label>
                        <input id="editposName" type="text" class="form-control" name="posName" placeholder="请输入设备名称"
                               minlength="3" required>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="editType"><span class="asterisk">*</span>设备类型:</label>
                        <select class="form-control" name="posType" id="editposType">
                            <option th:each="postype : ${postypes}" th:value="${postype.infoId}" th:text="${postype.info}">设备类型不存在</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="posRemark">设备备注:</label>
                        <input id="editposRemark" type="text" class="form-control" name="posRemark" placeholder="请输入设备备注"
                               minlength="1">
                        <div class="help-block with-errors"></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="expendMoney"><span class="asterisk">*</span>消费金额:</label>
                        <input id="editexpendMoney" oninput="num(this)"  type="text" class="form-control" name="expendMoney" placeholder="请输入消费金额"
                               minlength="1" required>
                        <div class="help-block with-errors"></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="ipAddress">ip地址:</label>
                        <input id="editipAddress" type="text" class="form-control" name="ipAddress" placeholder="请输入ip地址"
                               minlength="3" oninput="this.value=this.value.replace(/[^0-9\.]/g,'')">
                        <div class="help-block with-errors"></div>
                    </div>

                    <div id="editWX">
                        <hr/>
                        <h4 class="modal-title" id="editwxzf">微信支付</h4>
                        <input type="hidden"  id="editpayType">
                        <input type="hidden"  id="editwxIsCallback">
                        <div class="form-group">
                            <label class="control-label" for="type"><span class="asterisk">*</span>支付类型:</label>
                            <select name="editpaytype1" id="editpaytype1" multiple class="form-control select2">
                                <option th:each="paytype : ${paytypes}" th:value="${paytype.payType}" th:text="${paytype.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" ><span class="asterisk">*</span>需要子商户:</label>
                            需要<input type="radio"  name="editwxIsEvery" id="editwxXiuyaoZiShangHu" value="1" onclick="editwxIsZiShangHu()">
                            不需要<input type="radio" name="editwxIsEvery" id="editwxBuxiuyaoZiShangHu" value="0" onclick="editwxIsbuZiShangHu()" checked>
                            <div class="help-block with-errors" ></div>
                        </div>
                        <div class="form-group" id="editwxZiAppID" style="display:none">
                            <label class="control-label" for="WXChildAppID"><span class="asterisk">*</span>子商户AppID:</label>
                            <input id="editWXChildAppID"  type="text" class="form-control"  placeholder="输入子商户AppID">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editappID"><span class="asterisk">*</span>AppID:</label>
                            <input id="editappID" type="text" class="form-control"  placeholder="输入AppID">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editmchid"><span class="asterisk">*</span>Mchid:</label>
                            <input id="editmchid" type="text" class="form-control"  placeholder="输入Mchid">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editkey"><span class="asterisk">*</span>Key:</label>
                            <input id="editkey" type="text" class="form-control" placeholder="输入Key">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editunionpaytype"><span class="asterisk">*</span>选择导入的文件:</label>
                            <input type="file" id="editupload-file" />
                            <a id="editstart-upload" href="javascript:void(0);" onclick="uploadFile(1);">开始上传</a>
                        </div>
                        <div class="form-group" id="editwxCallbacks" style="display:none">
                            <label class="control-label" for="WXCallback"><span class="asterisk">*</span>回调地址:</label>
                            <input id="editWXCallback"  type="text" class="form-control" placeholder="输入回调地址">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editremark">备注:</label>
                            <input id="editremark" type="text" class="form-control" placeholder="输入备注">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="editZF">
                        <hr/>
                        <h4 class="modal-title" id="editzfb">支付宝支付</h4>

                        <input type="hidden"  id="editpayType2">
                        <div class="form-group">
                            <label class="control-label" for="type"><span class="asterisk">*</span>支付类型:</label>
                            <select name="zpaytype" id="editzpaytype" multiple class="form-control select2">
                                <option th:each="zpaytype : ${paytypes}" th:value="${zpaytype.payType}" th:text="${zpaytype.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <div class="form-group">
                            <label class="control-label" for="pid"><span class="asterisk">*</span>Pid:</label>
                            <textarea id="editpid" class="form-control" cols="50" rows="3" placeholder="输入Pid"></textarea>
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="appID1"><span class="asterisk">*</span>Appid:</label>
                            <textarea id="editappID1" class="form-control" cols="50" rows="3" placeholder="输入Appid"></textarea>
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="privateKey"><span class="asterisk">*</span>Privatekey:</label>
                            <textarea id="editprivateKey" class="form-control" cols="50" rows="3" placeholder="输入Privatekey"></textarea>
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="publicKey"><span class="asterisk">*</span>Publickey:</label>
                            <input id="editpublicKey"  class="form-control" placeholder="输入Publickey">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="alipayPublicKey"><span class="asterisk">*</span>AlipayPublicKey:</label>
                            <input id="editalipayPublicKey" type="text" class="form-control" placeholder="输入AlipayPublicKey">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="remark1">备注:</label>
                            <input id="editremark1" type="text" class="form-control"  placeholder="输入备注">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="editICBC">
                        <hr/>
                        <h4 class="modal-title" id="editicbcpay">工行聚合支付</h4>

                        <input type="hidden"  id="editicbcPayType">
                        <div class="form-group">
                            <label class="control-label" for="editicbcPayTypeselect"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="editicbcPayTypeselect" name="editicbcPayTypeselect" multiple class="form-control select2">
                                <option th:each="icbcpaytype : ${paytypes}" th:value="${icbcpaytype.payType}" th:text="${icbcpaytype.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <!--<div class="form-group">
                            <label class="control-label" for="editicbcMchid"><span class="asterisk">*</span>Mchid:</label>
                            <input id="editicbcMchid" type="text" class="form-control"  placeholder="输入Mchid">
                            <div class="help-block with-errors"></div>
                        </div>-->
                        <div class="form-group">
                            <label class="control-label" for="editicbcAppId"><span class="asterisk">*</span>AppId:</label>
                            <input id="editicbcAppId" type="text" class="form-control" placeholder="输入AppId">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editicbcPrivateKey"><span class="asterisk">*</span>Privatekey:</label>
                            <textarea id="editicbcPrivateKey" class="form-control" cols="50" rows="3" placeholder="输入Privatekey"></textarea>
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editicbcPublicKey"><span class="asterisk">*</span>PublicKey:</label>
                            <textarea id="editicbcPublicKey" class="form-control" cols="50" rows="3" placeholder="输入PublicKey"></textarea>
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editicbcRemark">备注:</label>
                            <input id="editicbcRemark" type="text" class="form-control" placeholder="输入备注">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="editUNION">
                        <hr/>
                        <h4 class="modal-title" id="editunionpay">银联支付</h4>

                        <input type="hidden"  id="editpayType4">
                        <div class="form-group">
                            <label class="control-label" for="editunionpaytype"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="editunionpaytype" name="editunionpaytype" multiple class="form-control select2">
                                <option th:each="unionpaytype : ${paytypes}" th:value="${unionpaytype.payType}" th:text="${unionpaytype.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editmchid1"><span class="asterisk">*</span>Mchid:</label>
                            <input id="editmchid1" type="text" class="form-control"  placeholder="输入Mchid">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editkey1"><span class="asterisk">*</span>Key:</label>
                            <input id="editkey1" type="text" class="form-control" placeholder="输入Key">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group" id="editunionCallbacks" style="display:none">
                            <label class="control-label" for="editunionCallback"><span class="asterisk">*</span>回调地址:</label>
                            <input id="editunionCallback" type="text" class="form-control" placeholder="输入回调地址">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editremark3">备注:</label>
                            <input id="editremark3" type="text" class="form-control" placeholder="输入备注">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="editQDNS">
                        <hr/>
                        <h4 class="modal-title" id="editqingDaoNongShang">青岛农商</h4>

                        <input type="hidden"  id="editpayType5">
                        <div class="form-group">
                            <label class="control-label" for="editqingDaoNongShangtype"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="editqingDaoNongShangtype" name="editqingDaoNongShangtype" multiple class="form-control select2">
                                <option th:each="qingDaoNongShangtype : ${paytypes}" th:value="${qingDaoNongShangtype.payType}" th:text="${qingDaoNongShangtype.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editcommid"><span class="asterisk">*</span>商户标识:</label>
                            <input id="editcommid" type="text" class="form-control"  placeholder="输入商户标识">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editcommoperid"><span class="asterisk">*</span>商户操作员编号:</label>
                            <input id="editcommoperid" type="text" class="form-control" placeholder="输入商户操作员编号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editcommstoreno"><span class="asterisk">*</span>商户门店编号:</label>
                            <input id="editcommstoreno" type="text" class="form-control" placeholder="输入商户门店编号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editdevsn"><span class="asterisk">*</span>机器终端编号:</label>
                            <input id="editdevsn" type="text" class="form-control" placeholder="输入机器终端编号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editqingDaoNongShangkey"><span class="asterisk">*</span>商户秘钥:</label>
                            <input id="editqingDaoNongShangkey" type="text" class="form-control" placeholder="输入商户秘钥">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editremark4">备注:</label>
                            <input id="editremark4" type="text" class="form-control" placeholder="输入备注">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="editShouQianBa">
                        <hr/>
                        <h4 class="modal-title" id="editShouQianBaTi">收钱吧</h4>

                        <input type="hidden"  id="editShouQianBaPayTypes">
                        <div class="form-group">
                            <label class="control-label" for="editShouQianBaPayType"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="editShouQianBaPayType" name="editShouQianBaPayType" multiple class="form-control select2">
                                <option th:each="ShouQianBaPaytype : ${paytypes}" th:value="${ShouQianBaPaytype.payType}" th:text="${ShouQianBaPaytype.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editterminal_sn"><span class="asterisk">*</span>终端号:</label>
                            <input id="editterminal_sn" type="text" class="form-control"  placeholder="输入终端号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editterminal_key"><span class="asterisk">*</span>终端密钥:</label>
                            <input id="editterminal_key" type="text" class="form-control" placeholder="输入终端密钥">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editremark5">备注:</label>
                            <input id="editremark5" type="text" class="form-control" placeholder="输入备注">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="editccbb">
                        <hr/>
                        <h4 class="modal-title" id="editccbbpay">龙支付</h4>
                        <input type="hidden"  id="editccbbChecked">
                        <input type="hidden"  id="editccbbPayTypes">
                        <div class="form-group">
                            <label class="control-label" for="editccbbPayType"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="editccbbPayType" name="editccbbPayType" multiple class="form-control select2">
                                <option th:each="ccbbPayType : ${paytypes}" th:value="${ccbbPayType.payType}" th:text="${ccbbPayType.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="ccbbPayType">聚合支付:</label>
                            <input type="checkbox" id="editcheckboxju" onclick="editcheckboxOnclick(this)"/>
                            <label class="control-label" for="ccbbPayType">人民币数字支付:</label>
                            <input type="checkbox" id="editcheckboxshu" onclick="editcheckboxTwoclick(this)"/>
                            <label class="control-label"  for="ccbbPayType">云闪付:</label>
                            <input type="checkbox" id="editcheckboxThree" onclick="editcheckboxThreeclick(this)"/>
                        </div>
                        <div id="editaggregation">
                            <div class="form-group">
                                <label class="control-label" for="editMERCHANTID"><span class="asterisk">*</span>聚合支付的商户号:</label>
                                <input id="editMERCHANTID" type="text" class="form-control"  placeholder="输入商户号">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="editPOSID"><span class="asterisk">*</span>聚合支付的柜台号:</label>
                                <input id="editPOSID" type="text" class="form-control" placeholder="输入柜台号">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="editBRANCHID"><span class="asterisk">*</span>聚合支付的分行号:</label>
                                <input id="editBRANCHID" type="text" class="form-control" placeholder="输入柜台号">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="editccbbPubKey"><span class="asterisk">*</span>聚合支付的公钥:</label>
                                <input id="editccbbPubKey" type="text" class="form-control" placeholder="输入公钥">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="editUSERID"><span class="asterisk">*</span>操作员号:</label>
                                <input id="editUSERID" type="text" class="form-control" placeholder="输入操作员号">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="editccbbPASSWORD"><span class="asterisk">*</span>密码:</label>
                                <input id="editccbbPASSWORD" type="text" class="form-control" placeholder="输入密码">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="editport"><span class="asterisk">*</span>端口号:</label>
                                <input id="editport" type="text" class="form-control" placeholder="输入端口号">
                                <div class="help-block with-errors"></div>
                            </div>
                        </div>
                        <div id="editDC">
                            <div class="form-group">
                                <label class="control-label" for="editDCMERCHANTID"><span class="asterisk">*</span>人民币数字的商户号:</label>
                                <input id="editDCMERCHANTID" type="text" class="form-control"  placeholder="输入商户号">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="editDCPOSID"><span class="asterisk">*</span>人民币数字的柜台号:</label>
                                <input id="editDCPOSID" type="text" class="form-control" placeholder="输入柜台号">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="editDCBRANCHID"><span class="asterisk">*</span>人民币数字的分行号:</label>
                                <input id="editDCBRANCHID" type="text" class="form-control" placeholder="输入分行号">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="editccbbDCPubKey"><span class="asterisk">*</span>人民币数字的公钥:</label>
                                <input id="editccbbDCPubKey" type="text" class="form-control" placeholder="输入公钥">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="editDCpubKey1"><span class="asterisk">*</span>瓦片公钥(PUBKEY1):</label>
                                <input id="editDCpubKey1" type="text" class="form-control" placeholder="输入瓦片公钥(PUBKEY1)">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="editDCpriKey1"><span class="asterisk">*</span>瓦片私钥(PRIBKEY1):</label>
                                <input id="editDCpriKey1" type="text" class="form-control" placeholder="输入瓦片私钥(PRIBKEY1)">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="editDCpubKey2"><span class="asterisk">*</span>瓦片平台关联密钥对(PUBKEY2):</label>
                                <input id="editDCpubKey2" type="text" class="form-control" placeholder="输入瓦片平台关联密钥对(PUBKEY2)">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="editDCFTCORPID"><span class="asterisk">*</span>瓦片调用方ID:</label>
                                <input id="editDCFTCORPID" type="text" class="form-control" placeholder="输入瓦片调用方ID">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="editDCUSERID"><span class="asterisk">*</span>人民币数字的操作员号:</label>
                                <input id="editDCUSERID" type="text" class="form-control" placeholder="输入人民币数字的操作员号">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="editDCPASSWORD"><span class="asterisk">*</span>人民币数字的操作员密码:</label>
                                <input id="editDCPASSWORD" type="text" class="form-control" placeholder="输入人民币数字的操作员密码">
                                <div class="help-block with-errors"></div>
                            </div>
                        </div>
                        <div id="editUNIONPAYPS">
                            <div class="form-group">
                                <label class="control-label" for="editappidUNIONPAYPS"><span class="asterisk">*</span>appid:</label>
                                <input id="editappidUNIONPAYPS" type="text" class="form-control"  placeholder="输入appid">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="editappkeyUNIONPAYPS"><span class="asterisk">*</span>appkey:</label>
                                <input id="editappkeyUNIONPAYPS" type="text" class="form-control"  placeholder="输入appkey">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="editmerchantCodeUNIONPAYPS"><span class="asterisk">*</span>商户号:</label>
                                <input id="editmerchantCodeUNIONPAYPS" type="text" class="form-control"  placeholder="输入商户号">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="editterminalCodeUNIONPAYPS"><span class="asterisk">*</span>终端号:</label>
                                <input id="editterminalCodeUNIONPAYPS" type="text" class="form-control"  placeholder="输入终端号">
                                <div class="help-block with-errors"></div>
                            </div>
                        </div>
                        <div class="form-group" id="editccbbCallbacks" style="display:none">
                            <label class="control-label" for="editccbbAPPID"><span class="asterisk">*</span>APPID:</label>
                            <input id="editccbbAPPID" type="text" class="form-control" placeholder="输入APPID">
                            <div class="help-block with-errors"></div>
                            <label class="control-label" for="editccbbCallback"><span class="asterisk">*</span>回调地址:</label>
                            <input id="editccbbCallback" type="text" class="form-control" placeholder="输入回调地址">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editccbbremark">备注:</label>
                            <input id="editccbbremark" type="text" class="form-control" placeholder="输入备注">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="editkancloud">
                        <hr/>
                        <h4 class="modal-title" id="editkancloudpay">移领支付</h4>

                        <input type="hidden"  id="editkancloudTypes">
                        <div class="form-group">
                            <label class="control-label" for="editkancloudType"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="editkancloudType" name="editkancloudType"  multiple class="form-control select2">
                                <option th:each="kancloudType : ${paytypes}" th:value="${kancloudType.payType}" th:text="${kancloudType.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editmerchantNum"><span class="asterisk">*</span>门店编号:</label>
                            <input id="editmerchantNum" type="text" class="form-control"  placeholder="输入门店编号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editkancloudKey"><span class="asterisk">*</span>交易密钥:</label>
                            <input id="editkancloudKey" type="text" class="form-control" placeholder="输入交易密钥">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editkancloudRemark">备注:</label>
                            <input id="editkancloudRemark" type="text" class="form-control" placeholder="输入备注">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="editleshua">
                        <hr/>
                        <h4 class="modal-title" id="editleshuas">乐刷支付</h4>

                        <input type="hidden"  id="editleshuaTypes">
                        <div class="form-group">
                            <label class="control-label" for="editleshuaType"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="editleshuaType" name="editleshuaType" multiple class="form-control select2">
                                <option th:each="leshuaType : ${paytypes}" th:value="${leshuaType.payType}" th:text="${leshuaType.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editleshuamerchantId"><span class="asterisk">*</span>商户号:</label>
                            <input id="editleshuamerchantId" type="text" class="form-control"  placeholder="输入商户号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editleshuaKey"><span class="asterisk">*</span>交易密钥:</label>
                            <input id="editleshuaKey" type="text" class="form-control" placeholder="输入交易密钥">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editleshuaRemark">备注:</label>
                            <input id="editleshuaRemark" type="text" class="form-control" placeholder="输入备注">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="editchinaums">
                        <hr/>
                        <h4 class="modal-title" id="editchinaumss">大华捷通</h4>

                        <input type="hidden"  id="editchinaumsIsCallback">
                        <input type="hidden"  id="editchinaumsTypes">
                        <div class="form-group">
                            <label class="control-label" for="editchinaumsType"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="editchinaumsType" name="editchinaumsType" multiple class="form-control select2">
                                <option th:each="chinaumsType : ${paytypes}" th:value="${chinaumsType.payType}" th:text="${chinaumsType.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editchinaumsmerchantId"><span class="asterisk">*</span>商户号:</label>
                            <input id="editchinaumsmerchantId" type="text" class="form-control"  placeholder="输入商户号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editchinaumsKey"><span class="asterisk">*</span>秘钥:</label>
                            <input id="editchinaumsKey" type="text" class="form-control" placeholder="输入秘钥">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editchinaumsdevsn"><span class="asterisk">*</span>终端号:</label>
                            <input id="editchinaumsdevsn" type="text" class="form-control" placeholder="输入终端号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group" id="editchinaumsCallbacks" style="display:none">
                            <label class="control-label" for="editchinaumsCallback"><span class="asterisk">*</span>回调地址:</label>
                            <input id="editchinaumsCallback" type="text" class="form-control" placeholder="输入回调地址">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editchinaumsRemark">备注:</label>
                            <input id="editchinaumsRemark" type="text" class="form-control" placeholder="输入备注">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="editunionschool">
                        <hr/>
                        <h4 class="modal-title" id="editUNIONSCHOLLS">银联校园版</h4>

                        <input type="hidden"  id="editunionschoolIsCallback">
                        <input type="hidden"  id="editunionschoolTypes">
                        <div class="form-group">
                            <label class="control-label" for="editunionschoolType"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="editunionschoolType" name="editunionschoolType" multiple class="form-control select2">
                                <option th:each="unionschoolType : ${paytypes}" th:value="${unionschoolType.payType}" th:text="${unionschoolType.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editunionschoolBrandId"><span class="asterisk">*</span>品牌号:</label>
                            <input id="editunionschoolBrandId" type="text" class="form-control"  placeholder="输入品牌号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editunionschoolOpshopId"><span class="asterisk">*</span>门店号:</label>
                            <input id="editunionschoolOpshopId" type="text" class="form-control" placeholder="输入门店号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editunionschoolBussType"><span class="asterisk">*</span>业务类型:</label>
                            <input id="editunionschoolBussType" type="text" class="form-control" placeholder="输入业务类型">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editunionschoolKey"><span class="asterisk">*</span>秘钥:</label>
                            <input id="editunionschoolKey" type="text" class="form-control" placeholder="输入秘钥">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group" id="editunionschoolCallbacks" style="display:none">
                            <label class="control-label" for="unionschoolCallback"><span class="asterisk">*</span>回调地址:</label>
                            <input id="editunionschoolCallback" type="text" class="form-control" placeholder="输入回调地址">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editunionschoolRemark">备注:</label>
                            <input id="editunionschoolRemark" type="text" class="form-control" placeholder="输入备注">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button onclick="edityin()" type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="submit" form="editForm" class="btn btn-primary"
                        data-action="{type:'submit',form:'#editForm',url:'@{/pos/update}',after:'$.myAction.refreshTable'}">
                    确定
                </button>
            </div>
        </div>
    </div>
</div>
<!-- xiangqing Modal -->
<div class="modal fade" id="detailsModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="detailsModalLabel">设备详情</h4>
            </div>
            <div class="modal-body">
                <form id="detailsForm">

                    <div class="form-group">
                        <label class="control-label" for="type"><span class="asterisk">*</span>商户:</label>
                        <select name="companyId" id="detailscompanyId" class="form-control"
                                disabled="disabled">
                            <option th:each="company : ${companyList}" th:value="${company.companyId}" th:text="${company.companyName}">
                                商户不存在
                            </option>
                        </select>
                        <div class="help-block with-errors"></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="posNo"><span class="asterisk">*</span>pos编号:</label>
                        <input id="detailsposNo" type="text" oninput = "value=value.replace(/[^\d]/g,'')" class="form-control" name="posNo" placeholder="请输入pos编号"
                               minlength="3" disabled="disabled">
                        <div class="help-block with-errors"></div>
                    </div>
                    <div class="form-group" id="detailsZFQD">
                        <label class="control-label" for="type"><span class="asterisk">*</span>支付渠道:</label>
                        <select name="type" id="detailstype" multiple class="form-control select2"
                                disabled="disabled">
                            <option th:each="type : ${types}" th:value="${type.infoId}" th:text="${type.info}">
                                支付渠道
                            </option>
                        </select>
                        <div class="help-block with-errors"></div>
                    </div>

                    <div class="form-group">
                        <label class="control-label" for="posName"><span class="asterisk">*</span>设备名称:</label>
                        <input id="detailsposName" type="text" class="form-control" name="posName" placeholder="请输入设备名称"
                               minlength="3" disabled="disabled">
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="editType"><span class="asterisk">*</span>设备类型:</label>
                        <select class="form-control" name="posType" id="detailsposType" disabled="disabled">
                            <option th:each="postype : ${postypes}" th:value="${postype.infoId}" th:text="${postype.info}">设备类型不存在</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="posRemark">设备备注:</label>
                        <input id="detailsposRemark" type="text" class="form-control" name="posRemark" placeholder="请输入设备备注"
                               minlength="1" disabled="disabled">
                        <div class="help-block with-errors"></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="expendMoney"><span class="asterisk">*</span>消费金额:</label>
                        <input id="detailsexpendMoney" oninput="num(this)"  type="text" class="form-control" name="expendMoney" placeholder="请输入消费金额"
                               minlength="1" disabled="disabled">
                        <div class="help-block with-errors"></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="ipAddress">ip地址:</label>
                        <input id="detailsipAddress" type="text" class="form-control" name="ipAddress" placeholder="请输入ip地址"
                               minlength="3" oninput="this.value=this.value.replace(/[^0-9\.]/g,'')" disabled="disabled">
                        <div class="help-block with-errors"></div>
                    </div>

                    <div id="detailsWX">
                        <hr/>
                        <h4 class="modal-title" id="detailswxzf">微信支付</h4>

                        <div class="form-group">
                            <label class="control-label" for="type"><span class="asterisk">*</span>支付类型:</label>
                            <select name="detailspaytype1" id="detailspaytype1" multiple class="form-control select2" disabled="disabled">
                                <option th:each="paytype : ${paytypes}" th:value="${paytype.payType}" th:text="${paytype.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <div class="form-group">
                            <label class="control-label" ><span class="asterisk">*</span>需要子商户:</label>
                            需要<input type="radio"  name="detailswxIsEvery" id="detailswxXiuyaoZiShangHu" value="1" disabled="disabled">
                            不需要<input type="radio" name="detailswxIsEvery" id="detailswxBuxiuyaoZiShangHu" value="0" disabled="disabled">
                            <div class="help-block with-errors" ></div>
                        </div>
                        <div class="form-group" id="detailswxZiAppID" style="display:none">
                            <label class="control-label" for="WXChildAppID"><span class="asterisk">*</span>子商户AppID:</label>
                            <input id="detailsWXChildAppID" type="text" class="form-control"  placeholder="输入子商户AppID" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editappID"><span class="asterisk">*</span>AppID:</label>
                            <input id="detailsappID" type="text" class="form-control"  placeholder="输入AppID" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editmchid"><span class="asterisk">*</span>Mchid:</label>
                            <input id="detailsmchid" type="text" class="form-control"  placeholder="输入Mchid" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editkey"><span class="asterisk">*</span>Key:</label>
                            <input id="detailskey" type="text" class="form-control" placeholder="输入Key" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group" id="detailswxCallbacks" style="display:none">
                            <label class="control-label" for="WXCallback"><span class="asterisk">*</span>回调地址:</label>
                            <input id="detailsWXCallback" type="text" class="form-control" placeholder="输入回调地址" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="editremark">备注:</label>
                            <input id="detailsremark" type="text" class="form-control" placeholder="输入备注" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="detailsZF">
                        <hr/>
                        <h4 class="modal-title" id="detailszfb">支付宝支付</h4>

                        <input type="hidden"  id="detailspayType2">
                        <div class="form-group">
                            <label class="control-label" for="type"><span class="asterisk">*</span>支付类型:</label>
                            <select name="detailszpaytype" id="detailszpaytype" multiple class="form-control select2" disabled="disabled">
                                <option th:each="zpaytype : ${paytypes}" th:value="${zpaytype.payType}" th:text="${zpaytype.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <div class="form-group">
                            <label class="control-label" for="pid"><span class="asterisk">*</span>Pid:</label>
                            <textarea id="detailspid" class="form-control" cols="50" rows="3" placeholder="输入Pid" disabled="disabled"></textarea>
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="appID1"><span class="asterisk">*</span>Appid:</label>
                            <textarea id="detailsappID1" class="form-control" cols="50" rows="3" placeholder="输入Appid" disabled="disabled"></textarea>
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="privateKey"><span class="asterisk">*</span>Privatekey:</label>
                            <textarea id="detailsprivateKey" class="form-control" cols="50" rows="3" placeholder="输入Privatekey" disabled="disabled"></textarea>
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="publicKey"><span class="asterisk">*</span>Publickey:</label>
                            <input id="detailspublicKey"  class="form-control" placeholder="输入Publickey" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="alipayPublicKey"><span class="asterisk">*</span>AlipayPublicKey:</label>
                            <input id="detailsalipayPublicKey" type="text" class="form-control" placeholder="输入AlipayPublicKey" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="remark1">备注:</label>
                            <input id="detailsremark1" type="text" class="form-control"  placeholder="输入备注" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="detailsICBC">
                        <hr/>
                        <h4 class="modal-title" id="detailsicbcpay">工行聚合支付</h4>

                        <input type="hidden"  id="detailsicbcPayType">
                        <div class="form-group">
                            <label class="control-label" for="detailsicbcPayTypeselect"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="detailsicbcPayTypeselect" name="detailsicbcPayTypeselect" multiple class="form-control select2" disabled="disabled">
                                <option th:each="icbcpaytype : ${paytypes}" th:value="${icbcpaytype.payType}" th:text="${icbcpaytype.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <!--<div class="form-group">
                            <label class="control-label" for="detailsicbcMchid"><span class="asterisk">*</span>Mchid:</label>
                            <input id="detailsicbcMchid" type="text" class="form-control"   disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>-->
                        <div class="form-group">
                            <label class="control-label" for="detailsicbcAppId"><span class="asterisk">*</span>AppId:</label>
                            <input id="detailsicbcAppId" type="text" class="form-control"  disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailsicbcPrivateKey"><span class="asterisk">*</span>Privatekey:</label>
                            <textarea id="detailsicbcPrivateKey" class="form-control" cols="50" rows="3"  disabled="disabled"></textarea>
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailsicbcPublicKey"><span class="asterisk">*</span>PublicKey:</label>
                            <textarea id="detailsicbcPublicKey" class="form-control" cols="50" rows="3"  disabled="disabled"></textarea>
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailsicbcRemark">备注:</label>
                            <input id="detailsicbcRemark" type="text" class="form-control" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="detailsUNION">
                        <hr/>
                        <h4 class="modal-title" id="detailsunionpay">银联支付</h4>

                        <div class="form-group">
                            <label class="control-label" for="detailsunionpaytype"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="detailsunionpaytype" name="detailsunionpaytype" multiple class="form-control select2" disabled="disabled">
                                <option th:each="unionpaytype : ${paytypes}" th:value="${unionpaytype.payType}" th:text="${unionpaytype.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailsmchid1"><span class="asterisk">*</span>Mchid:</label>
                            <input id="detailsmchid1" name="detailsmchid1" type="text" class="form-control"  placeholder="输入Mchid" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailskey1"><span class="asterisk">*</span>Key:</label>
                            <input id="detailskey1" name="detailskey1" type="text" class="form-control" placeholder="输入Key" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group" id="detailsunionCallbacks" style="display:none">
                            <label class="control-label" for="detailsunionCallback"><span class="asterisk">*</span>回调地址:</label>
                            <input id="detailsunionCallback" type="text" class="form-control" placeholder="输入回调地址" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailsremark3">备注:</label>
                            <input id="detailsremark3" name="detailsremark3" type="text" class="form-control" placeholder="输入备注" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="detailsQDNS">
                        <hr/>
                        <h4 class="modal-title" id="detailsqingDaoNongShang">青岛农商</h4>
                        <div class="form-group">
                            <label class="control-label" for="detailsqingDaoNongShangtype"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="detailsqingDaoNongShangtype" name="detailsqingDaoNongShangtype" multiple class="form-control select2" disabled="disabled">
                                <option th:each="qingDaoNongShangtype : ${paytypes}" th:value="${qingDaoNongShangtype.payType}" th:text="${qingDaoNongShangtype.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailscommid">商户标识:</label>
                            <input id="detailscommid" type="text" class="form-control"  placeholder="输入商户标识" disabled="disabled">
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailscommoperid"><span class="asterisk">*</span>商户操作员编号:</label>
                            <input id="detailscommoperid" type="text" class="form-control" placeholder="输入商户操作员编号" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailscommstoreno"><span class="asterisk">*</span>商户门店编号:</label>
                            <input id="detailscommstoreno" type="text" class="form-control" placeholder="输入商户门店编号" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailsdevsn"><span class="asterisk">*</span>机器终端编号:</label>
                            <input id="detailsdevsn" type="text" class="form-control" placeholder="输入机器终端编号" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailsqingDaoNongShangkey"><span class="asterisk">*</span>商户秘钥:</label>
                            <input id="detailsqingDaoNongShangkey" type="text" class="form-control" placeholder="输入商户秘钥" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailsremark3">备注:</label>
                            <input id="detailsremark4" type="text" class="form-control" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="detailsShouQianBa">
                        <hr/>
                        <h4 class="modal-title" id="detailsShouQianBaTi">收钱吧</h4>

                        <input type="hidden"  id="detailsShouQianBaPayTypes">
                        <div class="form-group">
                            <label class="control-label" for="detailsShouQianBaPayType"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="detailsShouQianBaPayType" name="detailsShouQianBaPayType" multiple class="form-control select2" disabled="disabled">
                                <option th:each="ShouQianBaPaytype : ${paytypes}" th:value="${ShouQianBaPaytype.payType}" th:text="${ShouQianBaPaytype.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailsterminal_sn"><span class="asterisk">*</span>终端号:</label>
                            <input id="detailsterminal_sn" type="text" class="form-control"  placeholder="输入终端号" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailsterminal_key"><span class="asterisk">*</span>终端密钥:</label>
                            <input id="detailsterminal_key" type="text" class="form-control" placeholder="输入终端密钥" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailsremark5">备注:</label>
                            <input id="detailsremark5" type="text" class="form-control" placeholder="输入备注" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="detailsccbb">
                        <hr/>
                        <h4 class="modal-title" id="detailsccbbpay">龙支付</h4>

                        <div class="form-group">
                            <label class="control-label" for="detailsccbbPayType"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="detailsccbbPayType" disabled="disabled" name="detailsccbbPayType" multiple class="form-control select2">
                                <option th:each="ccbbPayType : ${paytypes}" th:value="${ccbbPayType.payType}" th:text="${ccbbPayType.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailsMERCHANTID"><span class="asterisk">*</span>商户号:</label>
                            <input id="detailsMERCHANTID" disabled="disabled" type="text" class="form-control"  placeholder="输入商户号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailsPOSID"><span class="asterisk">*</span>柜台号:</label>
                            <input id="detailsPOSID" disabled="disabled" type="text" class="form-control" placeholder="输入柜台号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailsBRANCHID"><span class="asterisk">*</span>分行号:</label>
                            <input id="detailsBRANCHID" disabled="disabled" type="text" class="form-control" placeholder="输入柜台号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailsccbbPubKey"><span class="asterisk">*</span>公钥:</label>
                            <input id="detailsccbbPubKey" disabled="disabled" type="text" class="form-control" placeholder="输入公钥">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailsccbbremark">备注:</label>
                            <input id="detailsccbbremark" disabled="disabled" type="text" class="form-control" placeholder="输入备注">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="detailskancloud">
                        <hr/>
                        <h4 class="modal-title" id="detailskancloudpay">移领支付</h4>

                        <div class="form-group">
                            <label class="control-label" for="detailskancloudType"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="detailskancloudType" multiple class="form-control select2" disabled="disabled" name="detailskancloudType">
                                <option th:each="kancloudType : ${paytypes}" th:value="${kancloudType.payType}" th:text="${kancloudType.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailsmerchantNum"><span class="asterisk">*</span>门店编号:</label>
                            <input id="detailsmerchantNum" type="text" class="form-control"  placeholder="输入门店编号" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailskancloudKey"><span class="asterisk">*</span>交易密钥:</label>
                            <input id="detailskancloudKey" type="text" class="form-control" placeholder="输入交易密钥" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailskancloudRemark">备注:</label>
                            <input id="detailskancloudRemark" type="text" class="form-control" placeholder="输入备注" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="detailsleshua">
                        <hr/>
                        <h4 class="modal-title" id="detailsleshuas">乐刷支付</h4>

                        <input type="hidden"  id="detailsleshuaTypes">
                        <div class="form-group">
                            <label class="control-label" for="detailsleshuaType"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="detailsleshuaType" name="detailsleshuaType" multiple class="form-control select2" disabled="disabled">
                                <option th:each="leshuaType : ${paytypes}" th:value="${leshuaType.payType}" th:text="${leshuaType.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailsleshuamerchantId"><span class="asterisk">*</span>商户号:</label>
                            <input id="detailsleshuamerchantId" type="text" class="form-control"  placeholder="输入商户号" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailsleshuaKey"><span class="asterisk">*</span>交易密钥:</label>
                            <input id="detailsleshuaKey" type="text" class="form-control" placeholder="输入交易密钥" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailsleshuaRemark">备注:</label>
                            <input id="detailsleshuaRemark" type="text" class="form-control" placeholder="输入备注" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="detailschinaums">
                        <hr/>
                        <h4 class="modal-title" id="detailschinaumss">大华捷通</h4>
                        <div class="form-group">
                            <label class="control-label" for="detailschinaumsType"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="detailschinaumsType" name="detailschinaumsType" multiple class="form-control select2" disabled="disabled">
                                <option th:each="chinaumsType : ${paytypes}" th:value="${chinaumsType.payType}" th:text="${chinaumsType.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailschinaumsmerchantId"><span class="asterisk">*</span>商户号:</label>
                            <input id="detailschinaumsmerchantId" type="text" class="form-control"  placeholder="输入商户号" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailschinaumsKey"><span class="asterisk">*</span>秘钥:</label>
                            <input id="detailschinaumsKey" type="text" class="form-control" placeholder="输入秘钥" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailschinaumsdevsn"><span class="asterisk">*</span>终端号:</label>
                            <input id="detailschinaumsdevsn" type="text" class="form-control" placeholder="输入终端号" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group" id="detailschinaumsCallbacks" style="display:none">
                            <label class="control-label" for="detailschinaumsCallback"><span class="asterisk">*</span>回调地址:</label>
                            <input id="detailschinaumsCallback" type="text" class="form-control" placeholder="输入回调地址" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailschinaumsRemark">备注:</label>
                            <input id="detailschinaumsRemark" type="text" class="form-control" placeholder="输入备注" disabled="disabled">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>

                    <div id="detailsunionschool">
                        <hr/>
                        <h4 class="modal-title" id="detailsUNIONSCHOLLS">银联校园版</h4>

                        <input type="hidden"  id="detailsunionschoolIsCallback">
                        <input type="hidden"  id="detailsunionschoolTypes">
                        <div class="form-group">
                            <label class="control-label" for="detailsunionschoolType"><span class="asterisk">*</span>支付类型:</label>
                            <select  id="detailsunionschoolType" name="detailsunionschoolType" disabled="disabled" multiple class="form-control select2">
                                <option th:each="unionschoolType : ${paytypes}" th:value="${unionschoolType.payType}" th:text="${unionschoolType.payTypeName}">
                                    支付渠道
                                </option>
                            </select>
                            <div class="help-block with-errors"></div>

                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailsunionschoolBrandId"><span class="asterisk">*</span>品牌号:</label>
                            <input id="detailsunionschoolBrandId" disabled="disabled" type="text" class="form-control"  placeholder="输入品牌号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailsunionschoolOpshopId"><span class="asterisk">*</span>门店号:</label>
                            <input id="detailsunionschoolOpshopId" disabled="disabled" type="text" class="form-control" placeholder="输入门店号">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailsunionschoolBussType"><span class="asterisk">*</span>业务类型:</label>
                            <input id="detailsunionschoolBussType" disabled="disabled" type="text" class="form-control" placeholder="输入业务类型">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailsunionschoolKey"><span class="asterisk">*</span>秘钥:</label>
                            <input id="detailsunionschoolKey" disabled="disabled" type="text" class="form-control" placeholder="输入秘钥">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group" id="detailsunionschoolCallbacks" style="display:none">
                            <label class="control-label" for="detailsunionschoolCallback"><span class="asterisk">*</span>回调地址:</label>
                            <input id="detailsunionschoolCallback" disabled="disabled" type="text" class="form-control" placeholder="输入回调地址">
                            <div class="help-block with-errors"></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="detailsunionschoolRemark">备注:</label>
                            <input id="detailsunionschoolRemark" disabled="disabled" type="text" class="form-control" placeholder="输入备注">
                            <div class="help-block with-errors"></div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button onclick="detailsyin()" type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="daoModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="daoModalLabel">导入</h4>
            </div>
            <div class="modal-body">
                <form id="daoForm">
                    <div class="form-group">
                        <input type="hidden" id="daocompanyName" name="companyName">
                        <label class="control-label" for="daoeditcompanyId"><span class="asterisk">*</span>商户:</label>
                        <select name="companyId" id="daoeditcompanyId" class="form-control"
                                data-placeholder="请从列表选择一项" required onchange="selChange()">
                            <option value="">请选择用户</option>
                            <option th:each="company : ${companyList}" th:value="${company.companyId}" th:text="${company.companyName}">
                                商户不存在
                            </option>
                        </select>
                        <div class="help-block with-errors"></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="daoPayChannelcompanyId"><span class="asterisk">*</span>支付渠道:</label>
                        <select name="payChannel" id="daoPayChannelcompanyId" class="form-control"
                                data-placeholder="请从列表选择一项" required>
                            <option value="">请选择支付渠道</option>
                            <option th:each="type : ${types}" th:value="${type.infoId}" th:text="${type.info}">
                                支付渠道不存在
                            </option>
                        </select>
                        <div class="help-block with-errors"></div>
                    </div>
                    <input type="hidden"  id="daopayType" name="payType">
                    <div class="form-group">
                        <label class="control-label" for="editunionpaytype"><span class="asterisk">*</span>支付类型:</label>
                        <select  id="daoUnionPayType" name="daoUnionPayType" multiple class="form-control select2">
                            <option th:each="daoUnionPayType : ${paytypes}" th:value="${daoUnionPayType.payType}" th:text="${daoUnionPayType.payTypeName}">
                                支付渠道
                            </option>
                        </select>
                        <div class="help-block with-errors"></div>
                    </div>
                    <div class="form-group">
                        <input type="file"onchange="importf(this)"/>
                        <input type="hidden" id="zi" name="filename"/>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="submit" form="daoForm" class="btn btn-primary"
                        data-action="{type:'submit',form:'#daoForm',url:'@{/pos/dao}',after:'$.myAction.refreshTable'}">
                    确定
                </button>
            </div>
            </div>
        </div>
    </div>
</div>

<!-- delete modal -->
<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteSmallModalLabel">
    <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title" id="deleteSmallModalLabel">删除设备信息</h4>
            </div>
            <div class="modal-body">
                <form id="deleteForm"></form>
                确定要删除选中的 <span class="records"></span> 条记录?
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" form="deleteForm" class="btn btn-primary"
                        data-action="{type:'submit',form:'#deleteForm',url:'@{/pos/delete-batch}',after:'$.myAction.refreshTable'}">
                    确定
                </button>
            </div>
        </div>
    </div>
</div>
<div id="actionButtons" class="admin-hide">
    <a class="like" href="javascript:void(0)" data-toggle="tooltip" title="详情"><i class="glyphicon glyphicon-heart"></i></a>　
    <a shiro:hasPermission="pos:update" class="edit ml10" href="javascript:void(0)" data-toggle="tooltip" title="编辑"><i class="glyphicon glyphicon-edit"></i></a>　
    <a shiro:hasPermission="pos:delete" class="remove ml10" href="javascript:void(0)" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-remove"></i></a>　
</div>

<script th:src="@{/static/js/xlsx.core.min.js}"></script>
<script th:inline="javascript">

    var $table = $('#table');

    $(function () {
        // bootstrap table初始化
        // http://bootstrap-table.wenzhixin.net.cn/zh-cn/documentation/
        $table.bootstrapTable({
            url: CONTEXT_PATH + '/pos/list',
            idField: 'id',
            columns: [
                {field: 'state', checkbox: true},
                {field: 'id', title: '编号', sortable: true, halign: 'left'},
                {field: 'posName', title: '设备名称', sortable: true, halign: 'left'},
                {field: 'posNo', title: 'pos编号', sortable: true, halign: 'left'},
                {field: 'companyName', title: '公司名称', sortable: false, halign: 'left'},
                {field: 'posType', title: '设备类型', sortable: false, halign: 'left',
                    formatter:function(value,row,index){
                        if (value == "1") { return '<div >' + '消费' + '</div>'; }
                        else if (value == "2") { return '<div >' + '发卡' + '</div>';  }
                        else if (value == "3") { return '<div >' + '充值' + '</div>';  }
                    }
                },
                {field: 'posRemark', title: '设备备注', sortable: false, halign: 'left'},
                {field: 'createTime', title: '创建时间', sortable: false, halign: 'left'},
                {field: 'changeTime', title: '修改时间', sortable: false, halign: 'left'},
                {
                    field: 'action',
                    title: '操作',
                    halign: 'center',
                    align: 'center',
                    formatter: 'actionFormatter',
                    events: 'actionEvents',
                    clickToSelect: false
                }
            ]
        });
    });

    /*===============================================导入========================================================*/



    //开始上传
    function uploadFile(i){
        var mchid=null;
        if (i==0){
            mchid=$("#mchid").val();
        }else {
            mchid=$("#editmchid").val();
        }
        if(mchid=='' || mchid==undefined || mchid==null){
            alert("商户号不能为空");
        }else {
            var formData = new FormData();
            if (i==0){
                formData.append("files", $("#upload-file")[0].files[0]);
            }else {
                formData.append("files", $("#editupload-file")[0].files[0]);
            }
            formData.append("mchid", mchid);
            console.log($("#mchid").val());
            $.ajax({
                type:'POST',
                url:CONTEXT_PATH +"/pos/shang",
                data:formData,
                contentType:false,
                processData:false,//这个很有必要，不然不行
                dataType:"json",
                mimeType:"multipart/form-data",
                success:function(data){
                    alert(data);
                },error: function (data) {
                    alert(data);
                }
            });
        }
    }



    var wb;//读取
    var rABS = false;

    //开始导入
    function importf(obj) {
        if(!obj.files) {
            return;
        }
        var f = obj.files[0];
        var reader = new FileReader();
        reader.onload = function(e) {
            var data = e.target.result;
            if(rABS) {
                wb = XLSX.read(btoa(fixdata(data)), {//手动转化
                    type: 'base64'
                });
            } else {
                wb = XLSX.read(data, {
                    type: 'binary'
                });
            }
            /**
             * wb.SheetNames[0]是获取Sheets中第一个Sheet的名字
             * wb.Sheets[Sheet名]获取第一个Sheet的数据
             */
            var excelJson = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
            document.getElementById("zi").value= JSON.stringify( excelJson );
        };
        if(rABS) {
            reader.readAsArrayBuffer(f);
        } else {
            reader.readAsBinaryString(f);
        }
    }

    //文件流转BinaryString
    function fixdata(data) {
        var o = "",
            l = 0,
            w = 10240;
        for(; l < data.byteLength / w; ++l) o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w +

            w)));
        o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w)));
        return o;
    }

    function selChange(){
        document.getElementById("daocompanyName").value=$("#daoeditcompanyId").find("option:selected").text();
    }
    $("#daoUnionPayType").change(function(){
        var reslist=$("#daoUnionPayType").select2("data");
        $("#daopayType").val(payTypes(reslist));
    });
    /*========================================================================================================*/
    // 数据表格展开内容
    function detailFormatter(index, row) {
        var html = [];
        $.each(row, function (key, value) {
            html.push('<p><b>' + key + ':</b> ' + value + '</p>');
        });
        return html.join('');
    }

    function editAfter(obj, row) {
        edityin();//绑定数据之前先清除

        document.getElementById("editid").value=row.id;

        if (row.ipAddress == undefined){
            document.getElementById("editipAddress").value="";
        }else {
            document.getElementById("editipAddress").value=row.ipAddress;
        }

        if (row.posRemark == undefined){
            document.getElementById("editposRemark").value="";
        }else {
            document.getElementById("editposRemark").value=row.posRemark;
        }

        var payChannel=row.payChannel;
        var channelInfos = row.channelInfos;
        var aid="";
        for (i in channelInfos) {
            var payType =channelInfos[i].payType;
            var j =channelInfos[i].payChannel;
            aid+=channelInfos[i].id+",";
            if (j==1){
                $("#editWX").show();
                change(j);
                editweixin(i);

                if (channelInfos[i].remark == undefined){
                    document.getElementById("editremark").value="";
                }else {
                    document.getElementById("editremark").value=channelInfos[i].remark;
                }
                var id = channelInfos[i].id;
                //判断是否选中子商户
                if (channelInfos[i].wxPayJsonVo.childMerchants==null || channelInfos[i].wxPayJsonVo.childMerchants==undefined){
                    $("#editwxZiAppID").hide();
                    $("#editWXChildAppID").removeAttr("name");
                    $("#editWXChildAppID").removeAttr("required");
                    $("#editwxXiuyaoZiShangHu").removeAttr("checked");
                    $("#editwxBuxiuyaoZiShangHu").attr("checked","checked");
                    document.getElementById("editWXChildAppID").value="";
                }else {
                    $("#editwxZiAppID").show();
                    $("#editwxBuxiuyaoZiShangHu").removeAttr("checked");
                    $("#editwxXiuyaoZiShangHu").attr("checked","checked");
                    document.getElementById("editWXChildAppID").value=channelInfos[i].wxPayJsonVo.childMerchants;
                }
                document.getElementById("editappID").value=channelInfos[i].wxPayJsonVo.appID;
                document.getElementById("editmchid").value=channelInfos[i].wxPayJsonVo.mchid;
                document.getElementById("editkey").value=channelInfos[i].wxPayJsonVo.key;
                document.getElementById("editpayType").value=payType;
                if (payType.substring(0,1) ==1) {
                    var groupId = "1";
                    $('#editForm').find('[name=editpaytype1]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editpaytype1]').trigger("change");
                    document.getElementById("editWXCallback").value=channelInfos[i].wxPayJsonVo.callbackAddress;
                }
                if (payType.substring(1,2) ==1) {
                    var groupId = "2";
                    $('#editForm').find('[name=editpaytype1]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editpaytype1]').trigger("change");
                }
                if (payType.substring(2,3) ==1) {
                    var groupId = "3";
                    $('#editForm').find('[name=editpaytype1]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editpaytype1]').trigger("change");
                    document.getElementById("editWXCallback").value=channelInfos[i].wxPayJsonVo.callbackAddress;
                }
            }else if (j==2) {
                $("#editZF").show();
                change(j);
                editzhifubao(i);

                if (channelInfos[i].remark == undefined){
                    document.getElementById("editremark1").value="";
                }else {
                    document.getElementById("editremark1").value=channelInfos[i].remark;
                }
                document.getElementById("editpid").value=channelInfos[i].zfbPayJsonVo.pid;
                document.getElementById("editappID1").value=channelInfos[i].zfbPayJsonVo.appID;
                document.getElementById("editprivateKey").value=channelInfos[i].zfbPayJsonVo.privateKey;
                document.getElementById("editpublicKey").value=channelInfos[i].zfbPayJsonVo.publicKey;
                document.getElementById("editalipayPublicKey").value=channelInfos[i].zfbPayJsonVo.alipayPublicKey;
                document.getElementById("editpayType2").value=payType;

                if (payType.substring(0,1) ==1) {
                    var groupId = "1";
                    $('#editForm').find('[name=zpaytype]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=zpaytype]').trigger("change");
                }
                if (payType.substring(1,2) ==1) {
                    var groupId = "2";
                    $('#editForm').find('[name=zpaytype]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=zpaytype]').trigger("change");
                }
                if (payType.substring(2,3) ==1) {
                    var groupId = "3";
                    $('#editForm').find('[name=zpaytype]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=zpaytype]').trigger("change");
                }
            }else if (j==3) {
                editicbc(i);
                change(j);

                if (channelInfos[i].remark == undefined){
                    document.getElementById("editicbcRemark").value="";
                }else {
                    document.getElementById("editicbcRemark").value=channelInfos[i].remark;
                }
                //document.getElementById("editicbcMchid").value=payCompanyInfos[i].icbcVo.merId;
                document.getElementById("editicbcAppId").value=channelInfos[i].icbcVo.appId;
                document.getElementById("editicbcPrivateKey").value=channelInfos[i].icbcVo.privateKey;
                document.getElementById("editicbcPublicKey").value=channelInfos[i].icbcVo.publicKey;
                document.getElementById("editicbcPayType").value=payType;

                if (payType.substring(0,1) ==1) {
                    var groupId = "1";
                    $('#editForm').find('[name=editicbcPayTypeselect]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editicbcPayTypeselect]').trigger("change");
                }
                if (payType.substring(1,2) ==1) {
                    var groupId = "2";
                    $('#editForm').find('[name=editicbcPayTypeselect]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editicbcPayTypeselect]').trigger("change");
                }
                if (payType.substring(2,3) ==1) {
                    var groupId = "3";
                    $('#editForm').find('[name=editicbcPayTypeselect]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editicbcPayTypeselect]').trigger("change");
                }
            }else if (j==4) {
                $("#editUNION").show();
                change(j);
                editunion(i);

                if (channelInfos[i].remark == undefined){
                    document.getElementById("editremark3").value="";
                }else {
                    document.getElementById("editremark3").value=channelInfos[i].remark;
                }
                document.getElementById("editmchid1").value=channelInfos[i].unionJsonPayVo.mchid;
                document.getElementById("editkey1").value=channelInfos[i].unionJsonPayVo.key;
                document.getElementById("editpayType4").value=payType;

                if (payType.substring(0,1) ==1) {
                    var groupId = "1";
                    $('#editForm').find('[name=editunionpaytype]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editunionpaytype]').trigger("change");
                    document.getElementById("editunionCallback").value=channelInfos[i].unionJsonPayVo.callbackAddress;
                }
                if (payType.substring(1,2) ==1) {
                    var groupId = "2";
                    $('#editForm').find('[name=editunionpaytype]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editunionpaytype]').trigger("change");
                }
                if (payType.substring(2,3) ==1) {
                    var groupId = "3";
                    $('#editForm').find('[name=editunionpaytype]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editunionpaytype]').trigger("change");
                    document.getElementById("editunionCallback").value=channelInfos[i].unionJsonPayVo.callbackAddress;
                }
            }else if (j==5) {
                var type = "5";
                $('#editForm').find('[name=type]').find('option[value=' + type + ']').prop('selected', true);
                $('#editForm').find('[name=type]').trigger("change");
                editQDNS(i);
                if (channelInfos[i].remark == undefined){
                    document.getElementById("editremark4").value="";
                }else {
                    document.getElementById("editremark4").value=channelInfos[i].remark;
                }
                document.getElementById("editcommid").value=channelInfos[i].qingDaoNongShangJsonVo.commid;
                document.getElementById("editcommoperid").value=channelInfos[i].qingDaoNongShangJsonVo.commoperid;
                document.getElementById("editcommstoreno").value=channelInfos[i].qingDaoNongShangJsonVo.commstoreno;
                document.getElementById("editdevsn").value=channelInfos[i].qingDaoNongShangJsonVo.devsn;
                document.getElementById("editqingDaoNongShangkey").value=channelInfos[i].qingDaoNongShangJsonVo.key;
                document.getElementById("editpayType5").value=payType;

                if (payType.substring(0,1) ==1) {
                    var groupId = "1";
                    $('#editForm').find('[name=editqingDaoNongShangtype]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editqingDaoNongShangtype]').trigger("change");
                }
                if (payType.substring(1,2) ==1) {
                    var groupId = "2";
                    $('#editForm').find('[name=editqingDaoNongShangtype]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editqingDaoNongShangtype]').trigger("change");
                }
                if (payType.substring(2,3) ==1) {
                    var groupId = "3";
                    $('#editForm').find('[name=editqingDaoNongShangtype]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editqingDaoNongShangtype]').trigger("change");
                }
            }else if (j==6) {
                var type = "6";

                $('#editForm').find('[name=type]').find('option[value=' + type + ']').prop('selected', true);
                $('#editForm').find('[name=type]').trigger("change");
                editShouQianBa(i);
                if (channelInfos[i].remark == undefined){
                    document.getElementById("editremark5").value="";
                }else {
                    document.getElementById("editremark5").value=channelInfos[i].remark;
                }
                document.getElementById("editterminal_sn").value=channelInfos[i].shouQianBaVo.terminal_sn;
                document.getElementById("editterminal_key").value=channelInfos[i].shouQianBaVo.terminal_key;
                document.getElementById("editShouQianBaPayTypes").value=payType;

                if (payType.substring(0,1) ==1) {
                    var groupId = "1";
                    $('#editForm').find('[name=editShouQianBaPayType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editShouQianBaPayType]').trigger("change");
                }
                if (payType.substring(1,2) ==1) {
                    var groupId = "2";
                    $('#editForm').find('[name=editShouQianBaPayType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editShouQianBaPayType]').trigger("change");
                }
                if (payType.substring(2,3) ==1) {
                    var groupId = "3";
                    $('#editForm').find('[name=editShouQianBaPayType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editShouQianBaPayType]').trigger("change");
                }
            }else if (j==7) {
                var type = "7";

                $('#editForm').find('[name=type]').find('option[value=' + type + ']').prop('selected', true);
                $('#editForm').find('[name=type]').trigger("change");
                editccbb(i);
                if (channelInfos[i].remark == undefined){
                    document.getElementById("editccbbremark").value="";
                }else {
                    document.getElementById("editccbbremark").value=channelInfos[i].remark;
                }

                if (channelInfos[i].ccbbVo.merchantid == undefined){
                    $("#editcheckboxju").prop("checked", false);
                    editcheckboxOnclick({checked:false});
                }else {
                    document.getElementById("editMERCHANTID").value=channelInfos[i].ccbbVo.merchantid;
                    document.getElementById("editPOSID").value=channelInfos[i].ccbbVo.posid;
                    document.getElementById("editBRANCHID").value=channelInfos[i].ccbbVo.branchid;
                    document.getElementById("editccbbPubKey").value=channelInfos[i].ccbbVo.publicKey;
                    document.getElementById("editUSERID").value=channelInfos[i].ccbbVo.userid;
                    document.getElementById("editccbbPASSWORD").value=channelInfos[i].ccbbVo.password;
                    document.getElementById("editport").value=channelInfos[i].ccbbVo.port;
                    $("#editcheckboxju").prop("checked", true);
                    editcheckboxOnclick({checked:true});
                }

                if (channelInfos[i].ccbbVo.dcmerchantid == undefined){
                    $("#editcheckboxshu").prop("checked", false);
                    editcheckboxTwoclick({checked:false});
                }else {
                    document.getElementById("editDCMERCHANTID").value=channelInfos[i].ccbbVo.dcmerchantid;
                    document.getElementById("editDCPOSID").value=channelInfos[i].ccbbVo.dcposid;
                    document.getElementById("editDCBRANCHID").value=channelInfos[i].ccbbVo.dcbranchid;
                    document.getElementById("editccbbDCPubKey").value=channelInfos[i].ccbbVo.dcpublicKey;
                    document.getElementById("editDCpubKey1").value=channelInfos[i].ccbbVo.dcpubKey1;
                    document.getElementById("editDCpriKey1").value=channelInfos[i].ccbbVo.dcpriKey1;
                    document.getElementById("editDCpubKey2").value=channelInfos[i].ccbbVo.dcpubKey2;
                    document.getElementById("editDCFTCORPID").value=channelInfos[i].ccbbVo.dcftcorpid;
                    document.getElementById("editDCUSERID").value=channelInfos[i].ccbbVo.dcuserid;
                    document.getElementById("editDCPASSWORD").value=channelInfos[i].ccbbVo.dcpassword;
                    $("#editcheckboxshu").prop("checked", true);
                    editcheckboxTwoclick({checked:true});
                }

                if (channelInfos[i].ccbbVo.appId == undefined){
                    $("#editcheckboxThree").prop("checked", false);
                    editcheckboxThreeclick({checked:false});
                }else {
                    document.getElementById("editappidUNIONPAYPS").value=channelInfos[i].ccbbVo.appId;
                    document.getElementById("editappkeyUNIONPAYPS").value=channelInfos[i].ccbbVo.appKey;
                    document.getElementById("editmerchantCodeUNIONPAYPS").value=channelInfos[i].ccbbVo.merchantCode;
                    document.getElementById("editterminalCodeUNIONPAYPS").value=channelInfos[i].ccbbVo.terminalCode;
                    $("#editcheckboxThree").prop("checked", true);
                    editcheckboxThreeclick({checked:true});
                }

                document.getElementById("editccbbPayTypes").value=payType;

                if (payType.substring(0,1) ==1) {
                    var groupId = "1";
                    $('#editForm').find('[name=editccbbPayType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editccbbPayType]').trigger("change");
                    document.getElementById("editccbbCallback").value=channelInfos[i].ccbbVo.callbackAddress;
                    document.getElementById("editccbbAPPID").value=channelInfos[i].ccbbVo.wxappid;
                }
                if (payType.substring(1,2) ==1) {
                    var groupId = "2";
                    $('#editForm').find('[name=editccbbPayType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editccbbPayType]').trigger("change");
                }
                if (payType.substring(2,3) ==1) {
                    var groupId = "3";
                    $('#editForm').find('[name=editccbbPayType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editccbbPayType]').trigger("change");
                    document.getElementById("editccbbCallback").value=channelInfos[i].wxPayJsonVo.callbackAddress;
                    document.getElementById("editccbbAPPID").value=channelInfos[i].ccbbVo.wxappid;
                }
            }else if (j==8) {
                var type = "8";

                $('#editForm').find('[name=type]').find('option[value=' + type + ']').prop('selected', true);
                $('#editForm').find('[name=type]').trigger("change");
                editkanclouds(i);
                if (channelInfos[i].remark == undefined){
                    document.getElementById("editkancloudRemark").value="";
                }else {
                    document.getElementById("editkancloudRemark").value=channelInfos[i].remark;
                }
                document.getElementById("editmerchantNum").value=channelInfos[i].kancloudVo.merchant_num;
                document.getElementById("editkancloudKey").value=channelInfos[i].kancloudVo.key;
                document.getElementById("editkancloudTypes").value=payType;

                if (payType.substring(0,1) ==1) {
                    var groupId = "1";
                    $('#editForm').find('[name=editkancloudType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editkancloudType]').trigger("change");
                }
                if (payType.substring(1,2) ==1) {
                    var groupId = "2";
                    $('#editForm').find('[name=editkancloudType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editkancloudType]').trigger("change");
                }
                if (payType.substring(2,3) ==1) {
                    var groupId = "3";
                    $('#editForm').find('[name=editkancloudType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editkancloudType]').trigger("change");
                }
            }else if (j==9) {
                var type = "9";

                $('#editForm').find('[name=type]').find('option[value=' + type + ']').prop('selected', true);
                $('#editForm').find('[name=type]').trigger("change");
                editleshua(i);
                if (channelInfos[i].remark == undefined){
                    document.getElementById("editleshuaRemark").value="";
                }else {
                    document.getElementById("editleshuaRemark").value=channelInfos[i].remark;
                }
                document.getElementById("editleshuamerchantId").value=channelInfos[i].leShua.merchant_id;
                document.getElementById("editleshuaKey").value=channelInfos[i].leShua.key;
                document.getElementById("editleshuaTypes").value=payType;

                if (payType.substring(0,1) ==1) {
                    var groupId = "1";
                    $('#editForm').find('[name=editleshuaType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editleshuaType]').trigger("change");
                }
                if (payType.substring(1,2) ==1) {
                    var groupId = "2";
                    $('#editForm').find('[name=editleshuaType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editleshuaType]').trigger("change");
                }
                if (payType.substring(2,3) ==1) {
                    var groupId = "3";
                    $('#editForm').find('[name=editleshuaType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editleshuaType]').trigger("change");
                }
            }else if (j==10) {
                var type = "10";

                $('#editForm').find('[name=type]').find('option[value=' + type + ']').prop('selected', true);
                $('#editForm').find('[name=type]').trigger("change");
                editchinaums(i);
                if (channelInfos[i].remark == undefined){
                    document.getElementById("editchinaumsRemark").value="";
                }else {
                    document.getElementById("editchinaumsRemark").value=channelInfos[i].remark;
                }
                document.getElementById("editchinaumsmerchantId").value=channelInfos[i].chinaums.merid;
                document.getElementById("editchinaumsKey").value=channelInfos[i].chinaums.key;
                document.getElementById("editchinaumsdevsn").value=channelInfos[i].chinaums.devsn;
                document.getElementById("editchinaumsCallback").value=channelInfos[i].chinaums.devsn;
                document.getElementById("editleshuaTypes").value=payType;

                if (payType.substring(0,1) ==1) {
                    var groupId = "1";
                    $('#editForm').find('[name=editchinaumsType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editchinaumsType]').trigger("change");
                    document.getElementById("editchinaumsCallback").value=channelInfos[i].chinaums.callbackAddress;
                }
                if (payType.substring(1,2) ==1) {
                    var groupId = "2";
                    $('#editForm').find('[name=editchinaumsType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editchinaumsType]').trigger("change");
                }
                if (payType.substring(2,3) ==1) {
                    var groupId = "3";
                    $('#editForm').find('[name=editchinaumsType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editchinaumsType]').trigger("change");
                    document.getElementById("editchinaumsCallback").value=channelInfos[i].chinaums.callbackAddress;
                }
            }else if (j==11) {
                var type = "11";

                $('#editForm').find('[name=type]').find('option[value=' + type + ']').prop('selected', true);
                $('#editForm').find('[name=type]').trigger("change");
                editunionschool(i);
                if (channelInfos[i].remark == undefined){
                    document.getElementById("editunionschoolRemark").value="";
                }else {
                    document.getElementById("editunionschoolRemark").value=channelInfos[i].remark;
                }
                document.getElementById("editunionschoolBrandId").value=channelInfos[i].unionSchool.brand_id;
                document.getElementById("editunionschoolOpshopId").value=channelInfos[i].unionSchool.op_shop_id;
                document.getElementById("editunionschoolBussType").value=channelInfos[i].unionSchool.buss_type;
                document.getElementById("editunionschoolKey").value=channelInfos[i].unionSchool.key;
                document.getElementById("unionschoolCallback").value=channelInfos[i].unionSchool.callbackAddress;
                document.getElementById("editleshuaTypes").value=payType;

                if (payType.substring(0,1) ==1) {
                    var groupId = "1";
                    $('#editForm').find('[name=editunionschoolType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editunionschoolType]').trigger("change");
                    document.getElementById("unionschoolCallback").value=channelInfos[i].unionSchool.callbackAddress;
                }
                if (payType.substring(1,2) ==1) {
                    var groupId = "2";
                    $('#editForm').find('[name=editunionschoolType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editunionschoolType]').trigger("change");
                }
                if (payType.substring(2,3) ==1) {
                    var groupId = "3";
                    $('#editForm').find('[name=editunionschoolType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#editForm').find('[name=editunionschoolType]').trigger("change");
                    document.getElementById("unionschoolCallback").value=channelInfos[i].unionSchool.callbackAddress;
                }
            }
        }
        document.getElementById("editoldpayChannel").value=aid;
    }

    function change(i) {
        $('#editForm').find('[name=type]').find('option[value=' + i + ']').prop('selected', true);
        $('#editForm').find('[name=type]').trigger("change");
    }
    
    function actionFormatter(value, row, index) {
        return $('#actionButtons').html();
    }

    window.actionEvents = {
        'click .like': function (e, value, row, index) {
            $('#detailsModal').modal('show')
            $('#detailsForm').fillForm(row);
            detailsAfter('', row);
            console.log(value, row, index);
        },
        'click .edit': function (e, value, row, index) {
            $('#editModal').modal('show')
            $('#editForm').fillForm(row);
            editAfter('', row);
            console.log(value, row, index);
        },
        'click .remove': function (e, value, row, index) {
            $('#deleteModal').modal('show');
            $('.records').html('1');
            var html = '';
            for (var key in row) {
                html += '<input type="hidden" name="' + key + '" value="' + row[key] + '">';
            }
            $('#deleteForm').html(html);
        }
    };
    function detailszhifubaogjhid() {
        $("#detailsZFGJ").hide();
        $("#detailsCSH").hide();
        $("#detailsbusInfo").hide();
    }
    function detailszhifubaogjshow() {
        $("#detailsZFGJ").hide();
        $("#detailsCSH").hide();
        $("#detailsbusInfo").hide();
    }
    //对详情进行一一赋值
    function detailsAfter(obj, row) {
        $("#detailsWX").hide();
        $("#detailsZF").hide();
        $("#detailsICBC").hide();
        $("#detailsUNION").hide();
        $("#detailsQDNS").hide();
        $("#detailsShouQianBa").hide();
        $("#detailskancloud").hide();
        $("#detailsccbb").hide();
        $("#detailsleshua").hide();
        $("#detailschinaums").hide();
        $("#detailsunionschool").hide();

        if (row.ipAddress == undefined){
            document.getElementById("detailsipAddress").value="";
        }else {
            document.getElementById("detailsipAddress").value=row.ipAddress;
        }

        if (row.posRemark == undefined){
            document.getElementById("editposRemark").value="";
        }else {
            document.getElementById("editposRemark").value=row.posRemark;
        }

        var payChannel=row.payChannel;
        var channelInfos = row.channelInfos;
        for (i in channelInfos) {
            var payType =channelInfos[i].payType;
            var j =channelInfos[i].payChannel;
            if (j==1){
                $("#detailsWX").show();
                detailschange(1)
                if (channelInfos[i].remark == undefined){
                    document.getElementById("detailsremark").value="";
                }else {
                    document.getElementById("detailsremark").value=channelInfos[i].remark;
                }
                //判断是否选中子商户
                if (channelInfos[i].wxPayJsonVo.childMerchants==null || channelInfos[i].wxPayJsonVo.childMerchants==undefined){
                    $("#detailswxZiAppID").hide();
                    $("#detailswxXiuyaoZiShangHu").removeAttr("checked");
                    $("#detailswxBuxiuyaoZiShangHu").attr("checked","checked");
                }else {
                    $("#detailswxZiAppID").show();
                    $("#detailswxBuxiuyaoZiShangHu").removeAttr("checked");
                    $("#detailswxXiuyaoZiShangHu").attr("checked","checked");
                    document.getElementById("detailsWXChildAppID").value=channelInfos[i].wxPayJsonVo.childMerchants;
                }
                document.getElementById("detailsappID").value=channelInfos[i].wxPayJsonVo.appID;
                document.getElementById("detailsmchid").value=channelInfos[i].wxPayJsonVo.mchid;
                document.getElementById("detailskey").value=channelInfos[i].wxPayJsonVo.key;
                if (payType.substring(0,1) ==1) {
                    var groupId = "1";
                    $('#detailsForm').find('[name=detailspaytype1]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailspaytype1]').trigger("change");
                    document.getElementById("detailsWXCallback").value=channelInfos[i].wxPayJsonVo.callbackAddress;
                    $("#detailswxCallbacks").show();
                }
                if (payType.substring(1,2) ==1) {
                    var groupId = "2";
                    $('#detailsForm').find('[name=detailspaytype1]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailspaytype1]').trigger("change");
                    $("#detailswxCallbacks").hide();
                }
                if (payType.substring(2,3) ==1) {
                    var groupId = "3";
                    $('#detailsForm').find('[name=detailspaytype1]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailspaytype1]').trigger("change");
                    document.getElementById("detailsWXCallback").value=channelInfos[i].wxPayJsonVo.callbackAddress;
                    $("#detailswxCallbacks").show();
                }
            }else if (j==2) {
                $("#detailsZF").show();
                detailschange(2)

                if (channelInfos[i].remark == undefined){
                    document.getElementById("detailsremark1").value="";
                }else {
                    document.getElementById("detailsremark1").value=channelInfos[i].remark;
                }
                document.getElementById("detailspid").value=channelInfos[i].zfbPayJsonVo.pid;
                document.getElementById("detailsappID1").value=channelInfos[i].zfbPayJsonVo.appID;
                document.getElementById("detailsprivateKey").value=channelInfos[i].zfbPayJsonVo.privateKey;
                document.getElementById("detailspublicKey").value=channelInfos[i].zfbPayJsonVo.publicKey;
                document.getElementById("detailsalipayPublicKey").value=channelInfos[i].zfbPayJsonVo.alipayPublicKey;

                if (payType.substring(0,1) ==1) {
                    var groupId = "1";
                    $('#detailsForm').find('[name=detailszpaytype]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailszpaytype]').trigger("change");
                }
                if (payType.substring(1,2) ==1) {
                    var groupId = "2";
                    $('#detailsForm').find('[name=detailszpaytype]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailszpaytype]').trigger("change");
                }
                if (payType.substring(2,3) ==1) {
                    var groupId = "3";
                    $('#detailsForm').find('[name=detailszpaytype]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailszpaytype]').trigger("change");
                }
            }else if (j==3) {
                detailschange(3)
                $("#detailsICBC").show();

                if (channelInfos[i].remark == undefined){
                    document.getElementById("detailsicbcRemark").value="";
                }else {
                    document.getElementById("detailsicbcRemark").value=channelInfos[i].remark;
                }
                //document.getElementById("detailsicbcMchid").value=payCompanyInfos[i].icbcVo.merId;
                document.getElementById("detailsicbcAppId").value=channelInfos[i].icbcVo.appId;
                document.getElementById("detailsicbcPrivateKey").value=channelInfos[i].icbcVo.privateKey;
                document.getElementById("detailsicbcPublicKey").value=channelInfos[i].icbcVo.publicKey;

                if (payType.substring(0,1) ==1) {
                    var groupId = "1";
                    $('#detailsForm').find('[name=detailsicbcPayTypeselect]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailsicbcPayTypeselect]').trigger("change");
                }
                if (payType.substring(1,2) ==1) {
                    var groupId = "2";
                    $('#detailsForm').find('[name=detailsicbcPayTypeselect]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailsicbcPayTypeselect]').trigger("change");
                }
                if (payType.substring(2,3) ==1) {
                    var groupId = "3";
                    $('#detailsForm').find('[name=detailsicbcPayTypeselect]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailsicbcPayTypeselect]').trigger("change");
                }
            }else if (j==4) {
                $("#detailsUNION").show();
                detailschange(4)

                if (channelInfos[i].remark == undefined){
                    document.getElementById("detailsremark3").value="";
                }else {
                    document.getElementById("detailsremark3").value=channelInfos[i].remark;
                }
                document.getElementById("detailsmchid1").value=channelInfos[i].unionJsonPayVo.mchid;
                document.getElementById("detailskey1").value=channelInfos[i].unionJsonPayVo.key;
                var isHuiDiao=0;
                if (payType.substring(0,1) ==1) {
                    var groupId = "1";
                    $('#detailsForm').find('[name=detailsunionpaytype]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailsunionpaytype]').trigger("change");

                    isHuiDiao=1;
                    document.getElementById("detailsunionCallback").value=channelInfos[i].unionJsonPayVo.callbackAddress;
                    $("#detailsunionCallbacks").show();
                }
                if (payType.substring(1,2) ==1) {
                    var groupId = "2";
                    $('#detailsForm').find('[name=detailsunionpaytype]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailsunionpaytype]').trigger("change");

                    if (isHuiDiao==0){
                        $("#detailsunionCallbacks").hide();
                    }
                }
                if (payType.substring(2,3) ==1) {
                    var groupId = "3";
                    $('#detailsForm').find('[name=detailsunionpaytype]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailsunionpaytype]').trigger("change");

                    isHuiDiao=1;
                    document.getElementById("detailsunionCallback").value=channelInfos[i].unionJsonPayVo.callbackAddress;
                    $("#detailsunionCallbacks").show();
                }
            }else if (j==5) {
                $("#detailsQDNS").show();
                var type = "5";
                $('#detailsForm').find('[name=type]').find('option[value=' + type + ']').prop('selected', true);
                $('#detailsForm').find('[name=type]').trigger("change");
                if (channelInfos[i].remark == undefined){
                    document.getElementById("detailsremark4").value="";
                }else {
                    document.getElementById("detailsremark4").value=channelInfos[i].remark;
                }
                document.getElementById("detailscommid").value=channelInfos[i].qingDaoNongShangJsonVo.commid;
                document.getElementById("detailscommoperid").value=channelInfos[i].qingDaoNongShangJsonVo.commoperid;
                document.getElementById("detailscommstoreno").value=channelInfos[i].qingDaoNongShangJsonVo.commstoreno;
                document.getElementById("detailsdevsn").value=channelInfos[i].qingDaoNongShangJsonVo.devsn;
                document.getElementById("detailsqingDaoNongShangkey").value=channelInfos[i].qingDaoNongShangJsonVo.key;

                if (payType.substring(0,1) ==1) {
                    var groupId = "1";
                    $('#detailsForm').find('[name=detailsqingDaoNongShangtype]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailsqingDaoNongShangtype]').trigger("change");
                }
                if (payType.substring(1,2) ==1) {
                    var groupId = "2";
                    $('#detailsForm').find('[name=detailsqingDaoNongShangtype]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailsqingDaoNongShangtype]').trigger("change");
                }
                if (payType.substring(2,3) ==1) {
                    var groupId = "3";
                    $('#detailsForm').find('[name=detailsqingDaoNongShangtype]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailsqingDaoNongShangtype]').trigger("change");
                }
            }else if (j==6) {
                $("#detailsShouQianBa").show();
                var type = "6";
                $('#detailsForm').find('[name=type]').find('option[value=' + type + ']').prop('selected', true);
                $('#detailsForm').find('[name=type]').trigger("change");
                if (channelInfos[i].remark == undefined){
                    document.getElementById("detailsremark5").value="";
                }else {
                    document.getElementById("detailsremark5").value=channelInfos[i].remark;
                }
                document.getElementById("detailsterminal_sn").value=channelInfos[i].shouQianBaVo.terminal_sn;
                document.getElementById("detailsterminal_key").value=channelInfos[i].shouQianBaVo.terminal_key;

                if (payType.substring(0,1) ==1) {
                    var groupId = "1";
                    $('#detailsForm').find('[name=detailsShouQianBaPayType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailsShouQianBaPayType]').trigger("change");
                }
                if (payType.substring(1,2) ==1) {
                    var groupId = "2";
                    $('#detailsForm').find('[name=detailsShouQianBaPayType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailsShouQianBaPayType]').trigger("change");
                }
                if (payType.substring(2,3) ==1) {
                    var groupId = "3";
                    $('#detailsForm').find('[name=detailsShouQianBaPayType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailsShouQianBaPayType]').trigger("change");
                }
            }else if (j==7) {
                $("#detailsccbb").show();
                var type = "7";
                $('#detailsForm').find('[name=type]').find('option[value=' + type + ']').prop('selected', true);
                $('#detailsForm').find('[name=type]').trigger("change");
                if (channelInfos[i].remark == undefined){
                    document.getElementById("detailsccbbremark").value="";
                }else {
                    document.getElementById("detailsccbbremark").value=channelInfos[i].remark;
                }

                document.getElementById("detailsMERCHANTID").value=channelInfos[i].ccbbVo.merchantid;
                document.getElementById("detailsPOSID").value=channelInfos[i].ccbbVo.posid;
                document.getElementById("detailsBRANCHID").value=channelInfos[i].ccbbVo.branchid;
                document.getElementById("detailsccbbPubKey").value=channelInfos[i].ccbbVo.publicKey;

                if (payType.substring(0,1) ==1) {
                    var groupId = "1";
                    $('#detailsForm').find('[name=detailsccbbPayType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailsccbbPayType]').trigger("change");
                }
                if (payType.substring(1,2) ==1) {
                    var groupId = "2";
                    $('#detailsForm').find('[name=detailsccbbPayType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailsccbbPayType]').trigger("change");
                }
                if (payType.substring(2,3) ==1) {
                    var groupId = "3";
                    $('#detailsForm').find('[name=detailsccbbPayType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailsccbbPayType]').trigger("change");
                }
            }else if (j==8) {
                $("#detailskancloud").show();
                var type = "8";
                $('#detailsForm').find('[name=type]').find('option[value=' + type + ']').prop('selected', true);
                $('#detailsForm').find('[name=type]').trigger("change");
                if (channelInfos[i].remark == undefined){
                    document.getElementById("detailskancloudRemark").value="";
                }else {
                    document.getElementById("detailskancloudRemark").value=channelInfos[i].remark;
                }
                document.getElementById("detailsmerchantNum").value=channelInfos[i].kancloudVo.merchant_num;
                document.getElementById("detailskancloudKey").value=channelInfos[i].kancloudVo.key;

                if (payType.substring(0,1) ==1) {
                    var groupId = "1";
                    $('#detailsForm').find('[name=detailskancloudType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailskancloudType]').trigger("change");
                }
                if (payType.substring(1,2) ==1) {
                    var groupId = "2";
                    $('#detailsForm').find('[name=detailskancloudType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailskancloudType]').trigger("change");
                }
                if (payType.substring(2,3) ==1) {
                    var groupId = "3";
                    $('#detailsForm').find('[name=detailskancloudType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailskancloudType]').trigger("change");
                }
            }else if (j==9) {
                $("#detailsleshua").show();
                var type = "9";
                $('#detailsForm').find('[name=type]').find('option[value=' + type + ']').prop('selected', true);
                $('#detailsForm').find('[name=type]').trigger("change");
                if (channelInfos[i].remark == undefined){
                    document.getElementById("detailsleshuaRemark").value="";
                }else {
                    document.getElementById("detailsleshuaRemark").value=channelInfos[i].remark;
                }
                document.getElementById("detailsleshuamerchantId").value=channelInfos[i].leShua.merchant_id;
                document.getElementById("detailsleshuaKey").value=channelInfos[i].leShua.key;

                if (payType.substring(0,1) ==1) {
                    var groupId = "1";
                    $('#detailsForm').find('[name=detailsleshuaType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailsleshuaType]').trigger("change");
                }
                if (payType.substring(1,2) ==1) {
                    var groupId = "2";
                    $('#detailsForm').find('[name=detailsleshuaType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailsleshuaType]').trigger("change");
                }
                if (payType.substring(2,3) ==1) {
                    var groupId = "3";
                    $('#detailsForm').find('[name=detailsleshuaType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailsleshuaType]').trigger("change");
                }
            }else if (j==10) {
                $("#detailschinaums").show();
                var type = "10";
                $('#detailsForm').find('[name=type]').find('option[value=' + type + ']').prop('selected', true);
                $('#detailsForm').find('[name=type]').trigger("change");
                if (channelInfos[i].remark == undefined){
                    document.getElementById("detailschinaumsRemark").value="";
                }else {
                    document.getElementById("detailschinaumsRemark").value=channelInfos[i].remark;
                }
                document.getElementById("detailschinaumsmerchantId").value=channelInfos[i].chinaums.merid;
                document.getElementById("detailschinaumsdevsn").value=channelInfos[i].chinaums.devsn;
                document.getElementById("detailschinaumsKey").value=channelInfos[i].chinaums.key;
                var isHuiDiao=0;
                if (payType.substring(0,1) ==1) {
                    isHuiDiao=1;
                    var groupId = "1";
                    $('#detailsForm').find('[name=detailschinaumsType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailschinaumsType]').trigger("change");
                    document.getElementById("detailschinaumsCallback").value=channelInfos[i].chinaums.callbackAddress;
                    $("#detailschinaumsCallbacks").show();
                }
                if (payType.substring(1,2) ==1) {
                    var groupId = "2";
                    $('#detailsForm').find('[name=detailschinaumsType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailschinaumsType]').trigger("change");
                    if (isHuiDiao==0){
                        $("#detailschinaumsCallbacks").hide();
                    }
                }
                if (payType.substring(2,3) ==1) {
                    isHuiDiao=1;
                    var groupId = "3";
                    $('#detailsForm').find('[name=detailschinaumsType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailschinaumsType]').trigger("change");
                    document.getElementById("detailschinaumsCallback").value=channelInfos[i].chinaums.callbackAddress;
                    $("#detailschinaumsCallbacks").show();
                }
            }else if (j==11) {
                $("#detailsunionschool").show();
                var type = "11";
                $('#detailsForm').find('[name=type]').find('option[value=' + type + ']').prop('selected', true);
                $('#detailsForm').find('[name=type]').trigger("change");
                if (channelInfos[i].remark == undefined){
                    document.getElementById("detailsunionschoolRemark").value="";
                }else {
                    document.getElementById("detailsunionschoolRemark").value=channelInfos[i].remark;
                }
                document.getElementById("detailsunionschoolBrandId").value=channelInfos[i].unionSchool.brand_id;
                document.getElementById("detailsunionschoolOpshopId").value=channelInfos[i].unionSchool.op_shop_id;
                document.getElementById("detailsunionschoolBussType").value=channelInfos[i].unionSchool.buss_type;
                document.getElementById("detailsunionschoolKey").value=channelInfos[i].unionSchool.key;
                var isHuiDiao=0;
                if (payType.substring(0,1) ==1) {
                    isHuiDiao=1;
                    var groupId = "1";
                    $('#detailsForm').find('[name=detailsunionschoolType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailsunionschoolType]').trigger("change");
                    document.getElementById("detailsunionschoolCallback").value=channelInfos[i].unionSchool.callbackAddress;
                    $("#detailsunionschoolCallbacks").show();
                }
                if (payType.substring(1,2) ==1) {
                    var groupId = "2";
                    $('#detailsForm').find('[name=detailsunionschoolType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailsunionschoolType]').trigger("change");
                    if (isHuiDiao==0){
                        $("#detailsunionschoolCallbacks").hide();
                    }
                }
                if (payType.substring(2,3) ==1) {
                    isHuiDiao=1;
                    var groupId = "3";
                    $('#detailsForm').find('[name=detailsunionschoolType]').find('option[value=' + groupId + ']').prop('selected', true);
                    $('#detailsForm').find('[name=detailsunionschoolType]').trigger("change");
                    document.getElementById("detailschinaumsCallback").value=channelInfos[i].unionSchool.callbackAddress;
                    $("#detailsunionschoolCallbacks").show();
                }
            }
        }
    }

    function detailschange(i) {
        $('#detailsForm').find('[name=type]').find('option[value=' + i + ']').prop('selected', true);
        $('#detailsForm').find('[name=type]').trigger("change");
    }
    /*===============================================新增=========================================================*/
    //点击关闭按钮
    function yin() {
        $("#WX").hide();
        $("#ZF").hide();
        $("#ICBC").hide();
        $("#UNION").hide();
        $("#QDNS").hide();
        $("#ShouQianBa").hide();
        $("#kancloud").hide();
        $("#ccbb").hide();
        $("#leshua").hide();
        $("#chinaums").hide();
        $("#unionschool").hide();
        $("#ksrcb").hide();
        $("#aggregation").hide();
        $("#DC").hide();
        $("#UNIONPAYPS").hide();
        removeAttr();

        //隐藏子商户
        $("#wxZiAppID").hide();
    }


    //获取下拉框选中的值，选择显示选中的支付渠道
    $("#type").change(function(){
        //要触发的事件

        //隐藏文本
        var all="";
        $("#WX").hide();
        $("#ZF").hide();
        $("#ICBC").hide();
        $("#UNION").hide();
        $("#QDNS").hide();
        $("#ShouQianBa").hide();
        $("#kancloud").hide();
        $("#ccbb").hide();
        $("#leshua").hide();
        $("#chinaums").hide();
        $("#unionschool").hide();
        $("#ksrcb").hide();
        $("#aggregation").hide();
        $("#DC").hide();
        $("#UNIONPAYPS").hide();
        removeAttr();

        var reslist=$("#type").select2("data");
        var strPayChannel="00000000000000000000";
        for(var i=0;i<reslist.length;i++){
            all=reslist[i].text;
            if (all=="微信") {
                weixin(i);
                $("#paytype1").trigger("change");
                strPayChannel=replaceChat(strPayChannel,0,1);
                $("#WX").show();
            }else if (all=="支付宝") {
                zhifubao(i);
                strPayChannel=replaceChat(strPayChannel,1,1);
                $("#ZF").show();
            }else if (all=="工行聚合支付") {
                icbc(i);
                strPayChannel=replaceChat(strPayChannel,2,1);
                $("#ICBC").show();
            }else if (all=="银联支付") {
                union(i);
                $("#unionpaytype").trigger("change");
                strPayChannel=replaceChat(strPayChannel,3,1);
                $("#UNION").show();
            }else if (all=="青岛农商") {
                qingdaonongshang(i);
                strPayChannel=replaceChat(strPayChannel,4,1);
                $("#QDNS").show();
            }else if (all=="收钱吧") {
                shouqianba(i);
                strPayChannel=replaceChat(strPayChannel,5,1);
                $("#ShouQianBa").show();
            }else if (all=="龙支付") {
                ccbbs(i);
                strPayChannel=replaceChat(strPayChannel,6,1);
                $("#ccbb").show();
            }else if (all=="移领支付") {
                kanclouds(i);
                strPayChannel=replaceChat(strPayChannel,7,1);
                $("#kancloud").show();
            }else if (all=="乐刷") {
                leshua(i);
                strPayChannel=replaceChat(strPayChannel,8,1);
                $("#leshua").show();
            }else if (all=="大华捷通") {
                chinaums(i);
                $("#chinaumsType").trigger("change");
                strPayChannel=replaceChat(strPayChannel,9,1);
                $("#chinaums").show();
            }else if (all=="银联支付校园版") {
                unionschool(i);
                $("#unionschoolType").trigger("change");
                strPayChannel=replaceChat(strPayChannel,10,1);
                $("#unionschool").show();
            }else if (all=="江苏昆山农商银行") {
                ksrcb(i);
                strPayChannel=replaceChat(strPayChannel,12,1);
                $("#ksrcb").show();
            }
        }
        $("#payChannel").val(strPayChannel);
    });

    //微信
    //是不需要子商户，隐藏子商户
    function wxIsbuZiShangHu(){
        //隐藏微信的字商户
        $("#wxZiAppID").hide();
        $("#WXChildAppID").removeAttr("name");
        $("#WXChildAppID").removeAttr("required");
    }

    function wxIsZiShangHu(){
        //显示微信的字商户 WXChildAppID
        $("#wxZiAppID").show();
        $("#WXChildAppID").attr("name","channelInfos["+$("#wxIsCallback").val()+"].wxPayJsonVo.childMerchants");
        $("#WXChildAppID").attr("required","");
    }

    //微信的input 标签中 添加属性
    function weixin(i){

        $("#appID").attr("name","channelInfos["+i+"].wxPayJsonVo.appID");
        $("#mchid").attr("name","channelInfos["+i+"].wxPayJsonVo.mchid");
        $("#key").attr("name","channelInfos["+i+"].wxPayJsonVo.key");
        $("#remark").attr("name","channelInfos["+i+"].remark");
        $("#payType").attr("name","channelInfos["+i+"].payType");
        $("#paytype1").attr("name","paytype1");

        $("#paytype1").attr("data-placeholder","请从列表选择一项");
        $("#paytype1").attr("required","");
        $("#appID").attr("required","");
        $("#mchid").attr("required","");
        $("#key").attr("required","");

        //判断是否需要子商户
        $("#wxIsCallback").val(i);
        var val=$('input:radio[name="wxIsEvery"]:checked').val();
        if (val=="1") {
            wxIsZiShangHu();
        }
    }

    $("#paytype1").change(function(){
        var reslist=$("#paytype1").select2("data");
        var payTypeString=payTypes(reslist);
        $("#payType").val(payTypeString);
        WXcallback(payTypeString);
    });

    //判断是否需要回调地址
    function WXcallback(payTypeString){
        if (payTypeString.substr(0,1)=="1" || payTypeString.substr(2,1)=="1"
            || payTypeString.substr(3,1)=="1"){
            $("#wxCallbacks").show();
            $("#WXCallback").attr("name","channelInfos["+$("#wxIsCallback").val()+"].wxPayJsonVo.callbackAddress");
            $("#WXCallback").attr("required","");
        }else {
            $("#wxCallbacks").hide();
            $("#WXCallback").removeAttr("name");
            $("#WXCallback").removeAttr("required");
        }
    }
    //移除input 标签中的属性
    function removeAttr(){
        //回调和子商户
        $("#WXCallback").removeAttr("name");
        $("#WXCallback").removeAttr("required");
        $("#WXChildAppID").removeAttr("name");
        $("#WXChildAppID").removeAttr("required");

        $("#appID").removeAttr("name");
        $("#mchid").removeAttr("name");
        $("#key").removeAttr("name");
        $("#remark").removeAttr("name");
        $("#payType").removeAttr("name");
        $("#paytype1").removeAttr("name");

        $("#appID1").removeAttr("name");
        $("#pid").removeAttr("name");
        $("#privateKey").removeAttr("name");
        $("#publicKey").removeAttr("name");
        $("#alipayPublicKey").removeAttr("name");
        $("#remark1").removeAttr("name");
        $("#payType2").removeAttr("name");
        $("#zpaytype").removeAttr("name");

        $("#mchid1").removeAttr("name");
        $("#key1").removeAttr("name");
        $("#remark3").removeAttr("name");
        $("#payType4").removeAttr("name");

        $("#zpaytype").removeAttr("data-placeholder");
        $("#zpaytype").removeAttr("required");
        $("#appID1").removeAttr("required");
        $("#pid").removeAttr("required");
        $("#privateKey").removeAttr("required");
        $("#publicKey").removeAttr("required");
        $("#alipayPublicKey").removeAttr("required");

        $("#paytype1").removeAttr("data-placeholder");
        $("#paytype1").removeAttr("required");
        $("#appID").removeAttr("required");
        $("#mchid").removeAttr("required");
        $("#key").removeAttr("required");

        $("#unionpaytype").removeAttr("data-placeholder");
        $("#unionpaytype").removeAttr("required");
        $("#mchid1").removeAttr("required");
        $("#key1").removeAttr("required");


        $("#payType5").removeAttr("name");
        $("#commid").removeAttr("name");
        $("#commoperid").removeAttr("name");
        $("#commstoreno").removeAttr("name");
        $("#devsn").removeAttr("name");
        $("#qingDaoNongShangkey").removeAttr("name");
        $("#remark4").removeAttr("name");


        $("#qingDaoNongShangtype").removeAttr("data-placeholder");
        $("#qingDaoNongShangtype").removeAttr("required");
        $("#commid").removeAttr("required");
        $("#commoperid").removeAttr("required");
        $("#commstoreno").removeAttr("required");
        $("#devsn").removeAttr("required");
        $("#qingDaoNongShangkey").removeAttr("required");

        //工行聚合支付
        //$("#icbcMchid").removeAttr("name");
        $("#icbcAppId").removeAttr("name");
        $("#icbcPrivateKey").removeAttr("name");
        $("#icbcPublicKey").removeAttr("name");
        $("#icbcRemark").removeAttr("name");

        $("#icbcPayTypeselect").removeAttr("data-placeholder");
        $("#icbcPayTypeselect").removeAttr("required");
        //$("#icbcMchid").removeAttr("required");
        $("#icbcAppId").removeAttr("required");
        $("#icbcPrivateKey").removeAttr("required");
        $("#icbcPublicKey").removeAttr("required");

        //收钱吧
        $("#ShouQianBaPayType").removeAttr("data-placeholder");
        $("#ShouQianBaPayType").removeAttr("required");
        $("#terminal_sn").removeAttr("required");
        $("#terminal_key").removeAttr("required");

        $("#ShouQianBaPayTypes").removeAttr("name");
        $("#terminal_sn").removeAttr("name");
        $("#terminal_key").removeAttr("name");
        $("#remark5").removeAttr("name");
        //移领支付
        $("#kancloudType").removeAttr("data-placeholder");
        $("#kancloudType").removeAttr("required");
        $("#merchantNum").removeAttr("required");
        $("#kancloudKey").removeAttr("required");

        $("#kancloudTypes").removeAttr("name");
        $("#merchantNum").removeAttr("name");
        $("#kancloudKey").removeAttr("name");
        $("#kancloudRemark").removeAttr("name");
        //龙支付
        $("#ccbbPayType").removeAttr("data-placeholder");
        $("#ccbbPayType").removeAttr("required");
        $("#MERCHANTID").removeAttr("required");
        $("#POSID").removeAttr("required");
        $("#BRANCHID").removeAttr("required");
        $("#ccbbPubKey").removeAttr("required");
        $("#ccbbPubKey").removeAttr("required");
        $("#USERID").removeAttr("required");
        $("#ccbbPASSWORD").removeAttr("required");
        $("#port").removeAttr("required");

        $("#ccbbCallback").removeAttr("required");
        $("#ccbbAPPID").removeAttr("required");
        $("#ccbbCallback").removeAttr("name");
        $("#ccbbAPPID").removeAttr("name");

        $("#DCMERCHANTID").removeAttr("required");
        $("#DCPOSID").removeAttr("required");
        $("#DCBRANCHID").removeAttr("required");
        $("#ccbbDCPubKey").removeAttr("required");
        $("#DCpubKey1").removeAttr("required");
        $("#DCpriKey1").removeAttr("required");
        $("#DCpubKey2").removeAttr("required");
        $("#DCFTCORPID").removeAttr("required");
        $("#DCUSERID").removeAttr("required");
        $("#DCPASSWORD").removeAttr("required");

        $("#ccbbPayTypes").removeAttr("name");
        $("#MERCHANTID").removeAttr("name");
        $("#POSID").removeAttr("name");
        $("#BRANCHID").removeAttr("name");
        $("#ccbbremark").removeAttr("name");
        $("#ccbbPubKey").removeAttr("name");
        $("#USERID").removeAttr("name");
        $("#ccbbPASSWORD").removeAttr("name");
        $("#port").removeAttr("name");

        $("#DCMERCHANTID").removeAttr("name");
        $("#DCPOSID").removeAttr("name");
        $("#DCBRANCHID").removeAttr("name");
        $("#ccbbDCPubKey").removeAttr("name");
        $("#DCpubKey1").removeAttr("name");
        $("#DCpriKey1").removeAttr("name");
        $("#DCpubKey2").removeAttr("name");
        $("#DCFTCORPID").removeAttr("name");
        $("#DCUSERID").removeAttr("name");
        $("#DCPASSWORD").removeAttr("name");

        //乐刷
        $("#leshuaType").removeAttr("data-placeholder");
        $("#leshuaType").removeAttr("required");
        $("#leshuamerchantId").removeAttr("required");
        $("#leshuaKey").removeAttr("required");

        $("#leshuaTypes").removeAttr("name");
        $("#leshuamerchantId").removeAttr("name");
        $("#leshuaKey").removeAttr("name");
        $("#leshuaRemark").removeAttr("name");

        //大华捷通
        $("#chinaumsType").removeAttr("data-placeholder");
        $("#chinaumsType").removeAttr("required");
        $("#chinaumsmerchantId").removeAttr("required");
        $("#chinaumsdevsn").removeAttr("required");
        $("#chinaumsKey").removeAttr("required");

        $("#chinaumsTypes").removeAttr("name");
        $("#chinaumsmerchantId").removeAttr("name");
        $("#chinaumsdevsn").removeAttr("name");
        $("#chinaumsKey").removeAttr("name");
        $("#chinaumsRemark").removeAttr("name");

        //银联校园版
        $("#unionschoolType").removeAttr("data-placeholder");
        $("#unionschoolType").removeAttr("required");
        $("#unionschoolBrandId").removeAttr("required");
        $("#unionschoolOpshopId").removeAttr("required");
        $("#unionschoolBussType").removeAttr("required");
        $("#unionschoolKey").removeAttr("required");

        $("#unionschoolTypes").removeAttr("name");
        $("#unionschoolBrandId").removeAttr("name");
        $("#unionschoolOpshopId").removeAttr("name");
        $("#unionschoolBussType").removeAttr("name");
        $("#unionschoolKey").removeAttr("name");
        $("#unionschoolRemark").removeAttr("name");

        //江苏昆山农商银行
        $("#ksrcbType").removeAttr("data-placeholder");
        $("#ksrcbType").removeAttr("required");
        $("#ksrcbSubMerNo").removeAttr("required");
        $("#ksrcbSubMerName").removeAttr("required");
        $("#ksrcbMerStoreNo").removeAttr("required");

        $("#ksrcbTypes").removeAttr("name");
        $("#ksrcbSubMerNo").removeAttr("name");
        $("#ksrcbSubMerName").removeAttr("name");
        $("#ksrcbMerStoreNo").removeAttr("name");
        $("#ksrcbRemark").removeAttr("name");
    }
     //选中支付类型的文本框的值，对隐藏的文本框赋值
    $("#companyId").change(function(){
       var companyName=$("#companyId").find("option:selected").text();
        $("#companyName").val(companyName);
    });


    $("#zpaytype").change(function(){
        var reslist=$("#zpaytype").select2("data");
        $("#payType2").val(payTypes(reslist));
    });

    $("#icbcPayTypeselect").change(function(){
        var reslist=$("#icbcPayTypeselect").select2("data");
        $("#icbcPayType").val(payTypes(reslist));
    });

    $("#unionpaytype").change(function(){
        var reslist=$("#unionpaytype").select2("data");
        var payTypeString=payTypes(reslist);
        unionCallback(payTypeString);
        $("#payType4").val(payTypeString);
    });

    //判断是否需要回调地址
    function unionCallback(payTypeString){
        if (payTypeString.substr(0,1)=="1" || payTypeString.substr(2,1)=="1"
            || payTypeString.substr(3,1)=="1"){
            $("#unionCallbacks").show();
            $("#unionCallback").attr("name","channelInfos["+$("#unionIsCallback").val()+"].unionJsonPayVo.callbackAddress");
            $("#unionCallback").attr("required","");
        }else {
            $("#unionCallbacks").hide();
            $("#unionCallback").removeAttr("name");
            $("#unionCallback").removeAttr("required");
        }
    }

    $("#qingDaoNongShangtype").change(function(){
        var reslist=$("#qingDaoNongShangtype").select2("data");
        $("#payType5").val(payTypes(reslist));
    });
    $("#ShouQianBaPayType").change(function(){
        var reslist=$("#ShouQianBaPayType").select2("data");
        $("#ShouQianBaPayTypes").val(payTypes(reslist));
    });
    $("#kancloudType").change(function(){
        var reslist=$("#kancloudType").select2("data");
        $("#kancloudTypes").val(payTypes(reslist));
    });
    $("#ccbbPayType").change(function(){
        var reslist=$("#ccbbPayType").select2("data");
        var payTypeString=payTypes(reslist);
        ccbbcallbackg(payTypeString);
        $("#ccbbPayTypes").val(payTypeString);
    });

    //判断是否需要回调地址
    function ccbbcallbackg(payTypeString){
        if (payTypeString.substr(0,1)=="1" || payTypeString.substr(2,1)=="1"
            || payTypeString.substr(3,1)=="1"){
            $("#ccbbCallbacks").show();
            $("#ccbbCallback").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.callbackAddress");
            $("#ccbbCallback").attr("required","");
            $("#ccbbAPPID").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.wxappid");
            $("#ccbbAPPID").attr("required","");
        }else {
            $("#ccbbCallbacks").hide();
            $("#ccbbCallback").removeAttr("name");
            $("#ccbbCallback").removeAttr("required");
            $("#ccbbAPPID").removeAttr("name");
            $("#ccbbAPPID").removeAttr("required");
        }
    }

    $("#leshuaType").change(function(){
        var reslist=$("#leshuaType").select2("data");
        $("#leshuaTypes").val(payTypes(reslist));
    });

    $("#chinaumsType").change(function(){
        var reslist=$("#chinaumsType").select2("data");
        var payTypeString=payTypes(reslist);
        chinaumsCallback(payTypeString);
        $("#chinaumsTypes").val(payTypeString);
    });

    //判断是否需要回调地址
    function chinaumsCallback(payTypeString){
        if (payTypeString.substr(0,1)=="1" || payTypeString.substr(2,1)=="1"
            || payTypeString.substr(3,1)=="1"){
            $("#chinaumsCallbacks").show();
            $("#chinaumsCallback").attr("name","channelInfos["+$("#chinaumsIsCallback").val()+"].chinaums.callbackAddress");
            $("#chinaumsCallback").attr("required","");
        }else {
            $("#chinaumsCallbacks").hide();
            $("#chinaumsCallback").removeAttr("name");
            $("#chinaumsCallback").removeAttr("required");
        }
    }

    $("#unionschoolType").change(function(){
        var reslist=$("#unionschoolType").select2("data");
        var payTypeString=payTypes(reslist);
        unionschoolCallback(payTypeString);
        $("#unionschoolTypes").val(payTypeString);
    });
    //判断是否需要回调地址
    function unionschoolCallback(payTypeString){
        if (payTypeString.substr(0,1)=="1" || payTypeString.substr(2,1)=="1"
            || payTypeString.substr(3,1)=="1"){
            $("#unionschoolCallbacks").show();
            $("#unionschoolCallback").attr("name","channelInfos["+$("#unionschoolIsCallback").val()+"].unionSchool.callbackAddress");
            $("#unionschoolCallback").attr("required","");
        }else {
            $("#unionschoolCallbacks").hide();
            $("#unionschoolCallback").removeAttr("name");
            $("#unionschoolCallback").removeAttr("required");
        }
    }

    $("#ksrcbType").change(function(){
        var reslist=$("#ksrcbType").select2("data");
        $("#ksrcbTypes").val(payTypes(reslist));
    });

    //龙支付
    function ccbbs(i) {
        $("#ccbbChecked").val(i);
        $("#ccbbPayTypes").attr("name","channelInfos["+i+"].payType");
        $("#ccbbremark").attr("name","channelInfos["+i+"].remark");
        $("#ccbbPayType").attr("data-placeholder","请从列表选择一项");
        $("#ccbbPayType").attr("required","");
    }
    function checkboxOnclick(checkbox){
        if ( checkbox.checked == true){
            $("#MERCHANTID").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.MERCHANTID");
            $("#POSID").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.POSID");
            $("#BRANCHID").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.BRANCHID");
            $("#ccbbPubKey").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.publicKey");
            $("#USERID").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.USERID");
            $("#ccbbPASSWORD").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.PASSWORD");
            $("#port").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.port");

            $("#MERCHANTID").attr("required","");
            $("#POSID").attr("required","");
            $("#BRANCHID").attr("required","");
            $("#ccbbPubKey").attr("required","");
            $("#USERID").attr("required","");
            $("#ccbbPASSWORD").attr("required","");
            $("#port").attr("required","");
            $("#aggregation").show();
        }else{
            $("#MERCHANTID").removeAttr("required");
            $("#POSID").removeAttr("required");
            $("#BRANCHID").removeAttr("required");
            $("#ccbbPubKey").removeAttr("required");
            $("#USERID").removeAttr("required");
            $("#PASSWORD").removeAttr("required");
            $("#port").removeAttr("required");

            $("#MERCHANTID").removeAttr("name");
            $("#POSID").removeAttr("name");
            $("#BRANCHID").removeAttr("name");
            $("#ccbbPubKey").removeAttr("name");
            $("#USERID").removeAttr("name");
            $("#PASSWORD").removeAttr("name");
            $("#port").removeAttr("name");
            $("#aggregation").hide();
        }
    }

    function checkboxTwoclick(checkbox){
        if ( checkbox.checked == true){
            $("#DCMERCHANTID").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.DCMERCHANTID");
            $("#DCPOSID").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.DCPOSID");
            $("#DCBRANCHID").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.DCBRANCHID");
            $("#ccbbDCPubKey").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.DCpublicKey");
            $("#DCpubKey1").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.DCpubKey1");
            $("#DCpriKey1").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.DCpriKey1");
            $("#DCpubKey2").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.DCpubKey2");
            $("#DCFTCORPID").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.DCFTCORPID");
            $("#DCUSERID").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.DCUSERID");
            $("#DCPASSWORD").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.DCPASSWORD");

            $("#DCMERCHANTID").attr("required","");
            $("#DCPOSID").attr("required","");
            $("#DCBRANCHID").attr("required","");
            $("#ccbbDCPubKey").attr("required","");
            $("#DCpubKey1").attr("required","");
            $("#DCpriKey1").attr("required","");
            $("#DCpubKey2").attr("required","");
            $("#DCFTCORPID").attr("required","");
            $("#DCUSERID").attr("required","");
            $("#DCPASSWORD").attr("required","");
            $("#DC").show();
        }else{
            $("#DCMERCHANTID").removeAttr("required");
            $("#DCPOSID").removeAttr("required");
            $("#DCBRANCHID").removeAttr("required");
            $("#ccbbDCPubKey").removeAttr("required");
            $("#DCpubKey1").removeAttr("required");
            $("#DCpriKey1").removeAttr("required");
            $("#DCpubKey2").removeAttr("required");
            $("#DCFTCORPID").removeAttr("required");
            $("#DCUSERID").removeAttr("required");
            $("#DCPASSWORD").removeAttr("required");

            $("#DCMERCHANTID").removeAttr("name");
            $("#DCPOSID").removeAttr("name");
            $("#DCBRANCHID").removeAttr("name");
            $("#ccbbDCPubKey").removeAttr("name");
            $("#DCpubKey1").removeAttr("name");
            $("#DCpriKey1").removeAttr("name");
            $("#DCpubKey2").removeAttr("name");
            $("#DCFTCORPID").removeAttr("name");
            $("#DCUSERID").removeAttr("name");
            $("#DCPASSWORD").removeAttr("name");
            $("#DC").hide();
        }
    }

    function checkboxThreeclick(checkbox){
        if ( checkbox.checked == true){
            $("#appidUNIONPAYPS").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.appId");
            $("#appkeyUNIONPAYPS").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.appKey");
            $("#merchantCodeUNIONPAYPS").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.merchantCode");
            $("#terminalCodeUNIONPAYPS").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.terminalCode");

            $("#appidUNIONPAYPS").attr("required","");
            $("#appkeyUNIONPAYPS").attr("required","");
            $("#merchantCodeUNIONPAYPS").attr("required","");
            $("#terminalCodeUNIONPAYPS").attr("required","");
            $("#UNIONPAYPS").show();
        }else {
            $("#appidUNIONPAYPS").removeAttr("required");
            $("#appkeyUNIONPAYPS").removeAttr("required");
            $("#merchantCodeUNIONPAYPS").removeAttr("required");
            $("#terminalCodeUNIONPAYPS").removeAttr("required");

            $("#appidUNIONPAYPS").removeAttr("name");
            $("#appkeyUNIONPAYPS").removeAttr("name");
            $("#merchantCodeUNIONPAYPS").removeAttr("name");
            $("#terminalCodeUNIONPAYPS").removeAttr("name");
            $("#UNIONPAYPS").hide();
        }
    }

    function checkboxFoucclick(checkbox){
        if ( checkbox.checked == true){
            $("#appidUNIONPAYPS").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.appId");
            $("#appkeyUNIONPAYPS").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.appKey");
            $("#merchantCodeUNIONPAYPS").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.merchantCode");
            $("#terminalCodeUNIONPAYPS").attr("name","channelInfos["+$("#ccbbChecked").val()+"].ccbbVo.terminalCode");

            $("#appidUNIONPAYPS").attr("required","");
            $("#appkeyUNIONPAYPS").attr("required","");
            $("#merchantCodeUNIONPAYPS").attr("required","");
            $("#terminalCodeUNIONPAYPS").attr("required","");
            $("#UNIONPAYPS").show();
        }else {
            $("#appidUNIONPAYPS").removeAttr("required");
            $("#appkeyUNIONPAYPS").removeAttr("required");
            $("#merchantCodeUNIONPAYPS").removeAttr("required");
            $("#terminalCodeUNIONPAYPS").removeAttr("required");

            $("#appidUNIONPAYPS").removeAttr("name");
            $("#appkeyUNIONPAYPS").removeAttr("name");
            $("#merchantCodeUNIONPAYPS").removeAttr("name");
            $("#terminalCodeUNIONPAYPS").removeAttr("name");
            $("#UNIONPAYPS").hide();
        }
    }

    //给工行聚合支付赋值
    function icbc(i) {
        $("#icbcAppId").attr("name","channelInfos["+i+"].icbcVo.appId");
        //$("#icbcMchid").attr("name","channelInfos["+i+"].icbcVo.merId");
        $("#icbcPrivateKey").attr("name","channelInfos["+i+"].icbcVo.privateKey");
        $("#icbcPublicKey").attr("name","channelInfos["+i+"].icbcVo.publicKey");
        $("#icbcPayType").attr("name","channelInfos["+i+"].payType");
        $("#icbcRemark").attr("name","channelInfos["+i+"].remark");

        $("#icbcPayTypeselect").attr("data-placeholder","请从列表选择一项");
        $("#icbcPayTypeselect").attr("required","");
        $("#icbcAppId").attr("required","");
        //$("#icbcMchid").attr("required","");
        $("#icbcPrivateKey").attr("required","");
        $("#icbcPublicKey").attr("required","");
    }


    //支付宝的input 标签中 添加属性
    function zhifubao(i){
        $("#appID1").attr("name","channelInfos["+i+"].zfbPayJsonVo.appID");
        $("#pid").attr("name","channelInfos["+i+"].zfbPayJsonVo.pid");
        $("#privateKey").attr("name","channelInfos["+i+"].zfbPayJsonVo.privateKey");
        $("#publicKey").attr("name","channelInfos["+i+"].zfbPayJsonVo.publicKey");
        $("#alipayPublicKey").attr("name","channelInfos["+i+"].zfbPayJsonVo.alipayPublicKey");
        $("#remark1").attr("name","channelInfos["+i+"].remark");
        $("#payType2").attr("name","channelInfos["+i+"].payType");
        $("#zpaytype").attr("name","zpaytype");

        $("#zpaytype").attr("data-placeholder","请从列表选择一项");
        $("#zpaytype").attr("required","");
        $("#appID1").attr("required","");
        $("#pid").attr("required","");
        $("#privateKey").attr("required","");
        $("#publicKey").attr("required","");
        $("#alipayPublicKey").attr("required","");
    }
    //给银联支付赋值
    function union(i) {
        $("#mchid1").attr("name","channelInfos["+i+"].unionJsonPayVo.mchid");
        $("#key1").attr("name","channelInfos["+i+"].unionJsonPayVo.key");
        $("#payType4").attr("name","channelInfos["+i+"].payType");
        $("#remark3").attr("name","channelInfos["+i+"].remark");

        $("#unionpaytype").attr("name","unionpaytype");
        $("#unionpaytype").attr("data-placeholder","请从列表选择一项");
        $("#unionpaytype").attr("required","");
        $("#mchid1").attr("required","");
        $("#key1").attr("required","");

        $("#unionIsCallback").val(i);
    }

    //给青岛农商赋值
    function qingdaonongshang(i) {
        $("#commid").attr("name","channelInfos["+i+"].qingDaoNongShangJsonVo.commid");
        $("#commoperid").attr("name","channelInfos["+i+"].qingDaoNongShangJsonVo.commoperid");
        $("#commstoreno").attr("name","channelInfos["+i+"].qingDaoNongShangJsonVo.commstoreno");
        $("#devsn").attr("name","channelInfos["+i+"].qingDaoNongShangJsonVo.devsn");
        $("#qingDaoNongShangkey").attr("name","channelInfos["+i+"].qingDaoNongShangJsonVo.key");

        $("#payType5").attr("name","channelInfos["+i+"].payType");
        $("#remark4").attr("name","channelInfos["+i+"].remark");

        $("#qingDaoNongShangtype").attr("data-placeholder","请从列表选择一项");
        $("#qingDaoNongShangtype").attr("required","");
        $("#commid").attr("required","");
        $("#commoperid").attr("required","");
        $("#commstoreno").attr("required","");
        $("#devsn").attr("required","");
        $("#qingDaoNongShangkey").attr("required","");
    }
    //收钱吧
    function shouqianba(i) {
        $("#terminal_sn").attr("name","channelInfos["+i+"].shouQianBaVo.terminal_sn");
        $("#terminal_key").attr("name","channelInfos["+i+"].shouQianBaVo.terminal_key");

        $("#ShouQianBaPayTypes").attr("name","channelInfos["+i+"].payType");
        $("#remark5").attr("name","channelInfos["+i+"].remark");

        $("#ShouQianBaPayType").attr("data-placeholder","请从列表选择一项");
        $("#ShouQianBaPayType").attr("required","");
        $("#terminal_sn").attr("required","");
        $("#terminal_key").attr("required","");
    }

    //移领支付
    function kanclouds(i) {
        $("#merchantNum").attr("name","channelInfos["+i+"].kancloudVo.merchant_num");
        $("#kancloudKey").attr("name","channelInfos["+i+"].kancloudVo.key");


        $("#kancloudTypes").attr("name","channelInfos["+i+"].payType");
        $("#kancloudRemark").attr("name","channelInfos["+i+"].remark");

        $("#kancloudType").attr("data-placeholder","请从列表选择一项");
        $("#kancloudType").attr("required","");
        $("#merchantNum").attr("required","");
        $("#kancloudKey").attr("required","");
    }

    //乐刷
    function leshua(i) {
        $("#leshuamerchantId").attr("name","channelInfos["+i+"].leShua.merchant_id");
        $("#leshuaKey").attr("name","channelInfos["+i+"].leShua.key");


        $("#leshuaTypes").attr("name","channelInfos["+i+"].payType");
        $("#leshuaRemark").attr("name","channelInfos["+i+"].remark");

        $("#leshuaType").attr("data-placeholder","请从列表选择一项");
        $("#leshuaType").attr("required","");
        $("#leshuamerchantId").attr("required","");
        $("#leshuaKey").attr("required","");
    }

    //大华捷通
    function chinaums(i){
        $("#chinaumsmerchantId").attr("name","channelInfos["+i+"].chinaums.merid");
        $("#chinaumsdevsn").attr("name","channelInfos["+i+"].chinaums.devsn");
        $("#chinaumsKey").attr("name","channelInfos["+i+"].chinaums.key");


        $("#chinaumsTypes").attr("name","channelInfos["+i+"].payType");
        $("#chinaumsRemark").attr("name","channelInfos["+i+"].remark");

        $("#chinaumsType").attr("data-placeholder","请从列表选择一项");
        $("#chinaumsType").attr("required","");
        $("#chinaumsmerchantId").attr("required","");
        $("#chinaumsdevsn").attr("required","");
        $("#chinaumsKey").attr("required","");

        $("#chinaumsIsCallback").val(i);
    }

    //银联校园版
    function unionschool(i){
        $("#unionschoolBrandId").attr("name","channelInfos["+i+"].unionSchool.brand_id");
        $("#unionschoolOpshopId").attr("name","channelInfos["+i+"].unionSchool.op_shop_id");
        $("#unionschoolBussType").attr("name","channelInfos["+i+"].unionSchool.buss_type");
        $("#unionschoolKey").attr("name","channelInfos["+i+"].unionSchool.key");


        $("#unionschoolTypes").attr("name","channelInfos["+i+"].payType");
        $("#unionschoolRemark").attr("name","channelInfos["+i+"].remark");

        $("#unionschoolType").attr("data-placeholder","请从列表选择一项");
        $("#unionschoolType").attr("required","");
        $("#unionschoolBrandId").attr("required","");
        $("#unionschoolOpshopId").attr("required","");
        $("#unionschoolBussType").attr("required","");
        $("#unionschoolKey").attr("required","");

        $("#unionschoolIsCallback").val(i);
    }

    //江苏昆山农商银行
    function ksrcb(i){
        $("#ksrcbSubMerNo").attr("name","channelInfos["+i+"].ksrcbVo.subMerNo");
        $("#ksrcbSubMerName").attr("name","channelInfos["+i+"].ksrcbVo.subMerName");
        $("#ksrcbMerStoreNo").attr("name","channelInfos["+i+"].ksrcbVo.MerStoreNo");


        $("#ksrcbTypes").attr("name","channelInfos["+i+"].payType");
        $("#ksrcbRemark").attr("name","channelInfos["+i+"].remark");

        $("#ksrcbType").attr("data-placeholder","请从列表选择一项");
        $("#ksrcbType").attr("required","");
        $("#ksrcbSubMerNo").attr("required","");
        $("#ksrcbSubMerName").attr("required","");
        $("#ksrcbMerStoreNo").attr("required","");
    }
    /*===============================================修改=========================================================*/

    $("#edittype").change(function(){
        //要触发的事件
        //移除input 标签中的属性
        var all="";
        $("#editWX").hide();
        $("#editZF").hide();
        $("#editICBC").hide();
        $("#editUNION").hide();
        $("#editQDNS").hide();
        $("#editShouQianBa").hide();
        $("#editkancloud").hide();
        $("#editccbb").hide();
        $("#editleshua").hide();
        $("#editchinaums").hide();
        $("#editunionschool").hide();
        editremoveAttr();

        var reslist=$("#edittype").select2("data");
        var strPaytype="000000000000000";
        for(var i=0;i<reslist.length;i++){
            all=reslist[i].text;
            if (all=="微信") {
                editweixin(i);
                $("#editpaytype1").trigger("change");
                strPaytype=replaceChat(strPaytype,0,1);
                $("#editWX").show();
            }else if (all=="支付宝") {
                editzhifubao(i);
                strPaytype=replaceChat(strPaytype,1,1);
                $("#editZF").show();
            }else if (all=="银联支付") {
                editunion(i);
                $("#editunionpaytype").trigger("change");
                strPaytype=replaceChat(strPaytype,3,1);
                $("#editUNION").show();
            }else if (all=="工行聚合支付") {
                editicbc(i);
                strPaytype=replaceChat(strPaytype,2,1);
                $("#editICBC").show();
            }else if (all=="青岛农商") {
                editQDNS(i);
                strPaytype=replaceChat(strPaytype,4,1);
                $("#editQDNS").show();
            }else if (all=="收钱吧") {
                editShouQianBa(i);
                strPaytype=replaceChat(strPaytype,5,1);
                $("#editShouQianBa").show();
            }else if (all=="龙支付") {
                editccbb(i);
                strPaytype=replaceChat(strPaytype,6,1);
                $("#editccbb").show();
            }else if (all=="移领支付") {
                editkanclouds(i);
                strPaytype=replaceChat(strPaytype,7,1);
                $("#editkancloud").show();
            }else if (all=="乐刷") {
                editleshua(i);
                strPaytype=replaceChat(strPaytype,8,1);
                $("#editleshua").show();
            }else if (all=="大华捷通") {
                editchinaums(i);
                $("#editchinaumsType").trigger("change");
                strPaytype=replaceChat(strPaytype,9,1);
                $("#editchinaums").show();
            }else if (all=="银联支付校园版") {
                editunionschool(i);
                $("#editunionschoolType").trigger("change");
                strPaytype=replaceChat(strPaytype,10,1);
                $("#editunionschool").show();
            }
        }
        $("#editpayChannel").val(strPaytype);
    });

    function editremoveAttr() {

        //回调和子商户
        $("#editWXCallback").removeAttr("name");
        $("#editWXCallback").removeAttr("required");
        $("#editWXChildAppID").removeAttr("name");
        $("#editWXChildAppID").removeAttr("required");

        $("#editappID").removeAttr("name");
        $("#editmchid").removeAttr("name");
        $("#editkey").removeAttr("name");
        $("#editremark").removeAttr("name");
        $("#editpayType").removeAttr("name");

        $("#editappID1").removeAttr("name");
        $("#editpid").removeAttr("name");
        $("#editprivateKey").removeAttr("name");
        $("#editpublicKey").removeAttr("name");
        $("#editalipayPublicKey").removeAttr("name");
        $("#editremark1").removeAttr("name");
        $("#editpayType2").removeAttr("name");

        $("#editmchid1").removeAttr("name");
        $("#editkey1").removeAttr("name");
        $("#editremark3").removeAttr("name");
        $("#editpayType4").removeAttr("name");

        $("#editunionpaytype").removeAttr("data-placeholder");
        $("#editunionpaytype").removeAttr("required");
        $("#editmchid1").removeAttr("required");
        $("#editkey1").removeAttr("required");

        $("#editzpaytype").removeAttr("data-placeholder");
        $("#editzpaytype").removeAttr("required");
        $("#editappID1").removeAttr("required");
        $("#editpid").removeAttr("required");
        $("#editprivateKey").removeAttr("required");
        $("#editpublicKey").removeAttr("required");
        $("#editalipayPublicKey").removeAttr("required");

        $("#editpaytype1").removeAttr("data-placeholder");
        $("#editpaytype1").removeAttr("required");
        $("#editappID").removeAttr("required");
        $("#editmchid").removeAttr("required");
        $("#editkey").removeAttr("required");

        $("#editpayType5").removeAttr("name");
        $("#editcommid").removeAttr("name");
        $("#editcommoperid").removeAttr("name");
        $("#editcommstoreno").removeAttr("name");
        $("#editdevsn").removeAttr("name");
        $("#editqingDaoNongShangkey").removeAttr("name");
        $("#editremark4").removeAttr("name");

        $("#editqingDaoNongShangtype").removeAttr("data-placeholder");
        $("#editqingDaoNongShangtype").removeAttr("required");
        $("#editcommid").removeAttr("required");
        $("#editcommoperid").removeAttr("required");
        $("#editcommstoreno").removeAttr("required");
        $("#editdevsn").removeAttr("required");
        $("#editqingDaoNongShangkey").removeAttr("required");

        //工行聚合支付
        $("#editicbcPayType").removeAttr("name");
        //$("#editicbcMchid").removeAttr("name");
        $("#editicbcAppId").removeAttr("name");
        $("#editicbcPrivateKey").removeAttr("name");
        $("#editicbcPublicKey").removeAttr("name");
        $("#editicbcRemark").removeAttr("name");

        $("#editicbcPayTypeselect").removeAttr("data-placeholder");
        $("#editicbcPayTypeselect").removeAttr("required");
        //$("#editicbcMchid").removeAttr("required");
        $("#editicbcAppId").removeAttr("required");
        $("#editicbcPrivateKey").removeAttr("required");
        $("#editicbcPublicKey").removeAttr("required");

        //收钱吧
        $("#editShouQianBaPayType").removeAttr("data-placeholder");
        $("#editShouQianBaPayType").removeAttr("required");
        $("#editterminal_sn").removeAttr("required");
        $("#editterminal_key").removeAttr("required");

        $("#editShouQianBaPayTypes").removeAttr("name");
        $("#editterminal_sn").removeAttr("name");
        $("#editterminal_key").removeAttr("name");
        $("#editremark5").removeAttr("name");

        //移领吧
        $("#editkancloudType").removeAttr("data-placeholder");
        $("#editkancloudType").removeAttr("required");
        $("#editmerchantNum").removeAttr("required");
        $("#editkancloudKey").removeAttr("required");

        $("#editkancloudTypes").removeAttr("name");
        $("#editmerchantNum").removeAttr("name");
        $("#editkancloudKey").removeAttr("name");
        $("#editkancloudRemark").removeAttr("name");
        //龙支付
        $("#editccbbPayType").removeAttr("data-placeholder");
        $("#editccbbPayType").removeAttr("required");
        $("#editMERCHANTID").removeAttr("required");
        $("#editPOSID").removeAttr("required");
        $("#editBRANCHID").removeAttr("required");
        $("#editccbbPubKey").removeAttr("required");
        $("#editUSERID").removeAttr("required");
        $("#editccbbPASSWORD").removeAttr("required");
        $("#editport").removeAttr("required");

        $("#editccbbAPPID").removeAttr("required");
        $("#editccbbCallback").removeAttr("required");
        $("#editccbbAPPID").removeAttr("name");
        $("#editccbbCallback").removeAttr("name");

        $("#editDCMERCHANTID").removeAttr("required");
        $("#editDCPOSID").removeAttr("required");
        $("#editDCBRANCHID").removeAttr("required");
        $("#editccbbDCPubKey").removeAttr("required");
        $("#editDCpubKey1").removeAttr("required");
        $("#editDCpriKey1").removeAttr("required");
        $("#editDCpubKey2").removeAttr("required");
        $("#editDCFTCORPID").removeAttr("required");
        $("#editDCUSERID").removeAttr("required");
        $("#editDCPASSWORD").removeAttr("required");

        $("#editappidUNIONPAYPS").removeAttr("required");
        $("#editappkeyUNIONPAYPS").removeAttr("required");
        $("#editmerchantCodeUNIONPAYPS").removeAttr("required");
        $("#editterminalCodeUNIONPAYPS").removeAttr("required");


        $("#editMERCHANTID").removeAttr("name");
        $("#editPOSID").removeAttr("name");
        $("#editBRANCHID").removeAttr("name");
        $("#editccbbPubKey").removeAttr("name");
        $("#editUSERID").removeAttr("name");
        $("#editccbbPASSWORD").removeAttr("name");
        $("#editport").removeAttr("name");

        $("#editDCMERCHANTID").removeAttr("name");
        $("#editDCPOSID").removeAttr("name");
        $("#editDCBRANCHID").removeAttr("name");
        $("#editccbbDCPubKey").removeAttr("name");
        $("#editDCpubKey1").removeAttr("name");
        $("#editDCpriKey1").removeAttr("name");
        $("#editDCpubKey2").removeAttr("name");
        $("#editDCFTCORPID").removeAttr("name");
        $("#editDCUSERID").removeAttr("name");
        $("#editDCPASSWORD").removeAttr("name");

        $("#editappidUNIONPAYPS").removeAttr("name");
        $("#editappkeyUNIONPAYPS").removeAttr("name");
        $("#editmerchantCodeUNIONPAYPS").removeAttr("name");
        $("#editterminalCodeUNIONPAYPS").removeAttr("name");

        $("#editccbbremark").removeAttr("name");
        $("#editccbbPayTypes").removeAttr("name");

        //乐刷
        $("#editleshuaType").removeAttr("data-placeholder");
        $("#editleshuaType").removeAttr("required");
        $("#editleshuamerchantId").removeAttr("required");
        $("#editleshuaKey").removeAttr("required");

        $("#editleshuaTypes").removeAttr("name");
        $("#editleshuamerchantId").removeAttr("name");
        $("#editleshuaKey").removeAttr("name");
        $("#editleshuaRemark").removeAttr("name");

        //大华捷通
        $("#editchinaumsType").removeAttr("data-placeholder");
        $("#editchinaumsType").removeAttr("required");
        $("#editchinaumsmerchantId").removeAttr("required");
        $("#editchinaumsKey").removeAttr("required");

        $("#editchinaumsTypes").removeAttr("name");
        $("#editchinaumsmerchantId").removeAttr("name");
        $("#editchinaumsKey").removeAttr("name");
        $("#editchinaumsRemark").removeAttr("name");

        //银联校园版
        $("#editunionschoolType").removeAttr("data-placeholder");
        $("#editunionschoolType").removeAttr("required");
        $("#editunionschoolBrandId").removeAttr("required");
        $("#editunionschoolOpshopId").removeAttr("required");
        $("#editunionschoolBussType").removeAttr("required");
        $("#editunionschoolKey").removeAttr("required");

        $("#editunionschoolTypes").removeAttr("name");
        $("#editunionschoolBrandId").removeAttr("name");
        $("#editunionschoolOpshopId").removeAttr("name");
        $("#editunionschoolBussType").removeAttr("name");
        $("#editunionschoolKey").removeAttr("name");
        $("#editunionschoolRemark").removeAttr("name");
    }

    //微信
    //微信的input 标签中 添加属性
    function editweixin(i){
        $("#editappID").attr("name","channelInfos["+i+"].wxPayJsonVo.appID");
        $("#editmchid").attr("name","channelInfos["+i+"].wxPayJsonVo.mchid");
        $("#editkey").attr("name","channelInfos["+i+"].wxPayJsonVo.key");
        $("#editremark").attr("name","channelInfos["+i+"].remark");
        $("#editpayType").attr("name","channelInfos["+i+"].payType");

        $("#editpaytype1").attr("data-placeholder","请从列表选择一项");
        $("#editpaytype1").attr("required","");
        $("#editappID").attr("required","");
        $("#editmchid").attr("required","");
        $("#editkey").attr("required","");
        //判断是否需要子商户
        $("#editwxIsCallback").val(i);
        var val=$('input:radio[name="editwxIsEvery"]:checked').val();
        if (val=="1") {
            editwxIsZiShangHu();
        }
        //判断是否有回调地址
        var reslist=$("#editpaytype1").select2("data");
        var payTypeString=payTypes(reslist);
        $("#editpayType").val(payTypeString);
        editWXcallback(payTypeString);
    }

    //微信选中那个支付方式，把对应的值赋值给隐藏的文本框
    $("#editpaytype1").change(function(){
        var reslist=$("#editpaytype1").select2("data");
        var payTypeString=payTypes(reslist);
        $("#editpayType").val(payTypeString);
        editWXcallback(payTypeString);
    });

    //判断是否需要回调地址
    function editWXcallback(payTypeString){
        if (payTypeString.substr(0,1)=="1" || payTypeString.substr(2,1)=="1"
            || payTypeString.substr(3,1)=="1"){
            $("#editwxCallbacks").show();
            $("#editWXCallback").attr("name","channelInfos["+$("#editwxIsCallback").val()+"].wxPayJsonVo.callbackAddress");
            $("#editWXCallback").attr("required","");
        }else {
            $("#editwxCallbacks").hide();
            $("#editWXCallback").removeAttr("name");
            $("#editWXCallback").removeAttr("required");
        }
    }

    //是不需要子商户，隐藏子商户
    function editwxIsbuZiShangHu(){
        //隐藏微信的字商户
        $("#editwxZiAppID").hide();
        $("#editWXChildAppID").removeAttr("name");
        $("#editWXChildAppID").removeAttr("required");
    }

    function editwxIsZiShangHu(){
        //显示微信的字商户 WXChildAppID
        $("#editwxZiAppID").show();
        $("#editWXChildAppID").attr("name","channelInfos["+$("#editwxIsCallback").val()+"].wxPayJsonVo.childMerchants");
        $("#editWXChildAppID").attr("required","");
    }
    //清空微信
    function editweixinclear(){
        $("#editeditpaytype1").val(null).trigger("change");
        $("#editeditappID").val("");
        $("#editeditmchid").val("");
        $("#editeditkey").val("");
        $("#editeditremark").val("");
    }
    //清空支付宝
    function editzhifubaoclear(){
        $("#editzpaytype").val(null).trigger("change");
        $("#editappID1").val("");
        $("#editpid").val("");
        $("#editprivateKey").val("");
        $("#editpublicKey").val("");
        $("#editalipayPublicKey").val("");
        $("#editremark1").val("");
    }
    //清空银联支付的文本框
    //清空银联支付的文本框
    function editunionclear() {
        $("#editmchid1").val("");
        $("#editkey1").val("");
        $("#editremark3").val("");
    }

    //工行聚合支付
    function editicbc(i) {
        $("#editicbcAppId").attr("name","channelInfos["+i+"].icbcVo.appId");
        //$("#editicbcMchid").attr("name","channelInfos["+i+"].icbcVo.merId");
        $("#editicbcPrivateKey").attr("name","channelInfos["+i+"].icbcVo.privateKey");
        $("#editicbcPublicKey").attr("name","channelInfos["+i+"].icbcVo.publicKey");
        $("#editicbcPayType").attr("name","channelInfos["+i+"].payType");
        $("#editicbcRemark").attr("name","channelInfos["+i+"].remark");

        $("#editicbcPayTypeselect").attr("data-placeholder","请从列表选择一项");
        $("#editicbcPayTypeselect").attr("required","");
        $("#editicbcAppId").attr("required","");
        //$("#editicbcMchid").attr("required","");
        $("#editicbcPrivateKey").attr("required","");
        $("#editicbcPublicKey").attr("required","");
    }

    //支付宝的input 标签中 添加属性
    function editzhifubao(i){
        $("#editappID1").attr("name","channelInfos["+i+"].zfbPayJsonVo.appID");
        $("#editpid").attr("name","channelInfos["+i+"].zfbPayJsonVo.pid");
        $("#editprivateKey").attr("name","channelInfos["+i+"].zfbPayJsonVo.privateKey");
        $("#editpublicKey").attr("name","channelInfos["+i+"].zfbPayJsonVo.publicKey");
        $("#editalipayPublicKey").attr("name","channelInfos["+i+"].zfbPayJsonVo.alipayPublicKey");
        $("#editremark1").attr("name","channelInfos["+i+"].remark");
        $("#editpayType2").attr("name","channelInfos["+i+"].payType");

        $("#editzpaytype").attr("data-placeholder","请从列表选择一项");
        $("#editzpaytype").attr("required","");
        $("#editappID1").attr("required","");
        $("#editpid").attr("required","");
        $("#editprivateKey").attr("required","");
        $("#editpublicKey").attr("required","");
        $("#editalipayPublicKey").attr("required","");
    }
    //给银联支付赋值
    function editunion(i) {
        $("#editmchid1").attr("name","channelInfos["+i+"].unionJsonPayVo.mchid");
        $("#editkey1").attr("name","channelInfos["+i+"].unionJsonPayVo.key");
        $("#editpayType4").attr("name","channelInfos["+i+"].payType");
        $("#editremark3").attr("name","channelInfos["+i+"].remark");

        $("#editunionpaytype").attr("data-placeholder","请从列表选择一项");
        $("#editunionpaytype").attr("required","");
        $("#editmchid1").attr("required","");
        $("#editkey1").attr("required","");

        $("#editunionIsCallback").val(i);
    }

    //青岛农商
    function editQDNS(i) {
        $("#editcommid").attr("name","channelInfos["+i+"].qingDaoNongShangJsonVo.commid");
        $("#editcommoperid").attr("name","channelInfos["+i+"].qingDaoNongShangJsonVo.commoperid");
        $("#editcommstoreno").attr("name","channelInfos["+i+"].qingDaoNongShangJsonVo.commstoreno");
        $("#editdevsn").attr("name","channelInfos["+i+"].qingDaoNongShangJsonVo.devsn");
        $("#editqingDaoNongShangkey").attr("name","channelInfos["+i+"].qingDaoNongShangJsonVo.key");

        $("#editpayType5").attr("name","channelInfos["+i+"].payType");
        $("#editremark4").attr("name","channelInfos["+i+"].remark");

        $("#editqingDaoNongShangtype").attr("data-placeholder","请从列表选择一项");
        $("#editqingDaoNongShangtype").attr("required","");
        $("#editcommid").attr("required","");
        $("#editcommoperid").attr("required","");
        $("#editcommstoreno").attr("required","");
        $("#editdevsn").attr("required","");
        $("#editqingDaoNongShangkey").attr("required","");
    }

    //收钱吧
    function editShouQianBa(i) {
        $("#editterminal_sn").attr("name","channelInfos["+i+"].shouQianBaVo.terminal_sn");
        $("#editterminal_key").attr("name","channelInfos["+i+"].shouQianBaVo.terminal_key");

        $("#editShouQianBaPayTypes").attr("name","channelInfos["+i+"].payType");
        $("#editremark5").attr("name","channelInfos["+i+"].remark");

        $("#editShouQianBaPayType").attr("data-placeholder","请从列表选择一项");
        $("#editShouQianBaPayType").attr("required","");
        $("#editterminal_sn").attr("required","");
        $("#editterminal_key").attr("required","");
    }
    //移领支付
    function editkanclouds(i) {
        $("#editmerchantNum").attr("name","channelInfos["+i+"].kancloudVo.merchant_num");
        $("#editkancloudKey").attr("name","channelInfos["+i+"].kancloudVo.key");

        $("#editkancloudTypes").attr("name","channelInfos["+i+"].payType");
        $("#editkancloudRemark").attr("name","channelInfos["+i+"].remark");

        $("#editkancloudType").attr("data-placeholder","请从列表选择一项");
        $("#editkancloudType").attr("required","");
        $("#editmerchantNum").attr("required","");
        $("#editkancloudKey").attr("required","");
    }
    function editccbb(i) {




        $("#editccbbPayTypes").attr("name","channelInfos["+i+"].payType");
        $("#editccbbremark").attr("name","channelInfos["+i+"].remark");

        $("#editccbbPayType").attr("data-placeholder","请从列表选择一项");




        $("#editccbbChecked").val(i);
    }


    function editcheckboxOnclick(checkbox){
        console.log('已经进入程序'+ checkbox.checked);
        if ( checkbox.checked == true){
            $("#editMERCHANTID").attr("name","channelInfos["+$("#editccbbChecked").val()+"].ccbbVo.MERCHANTID");
            $("#editPOSID").attr("name","channelInfos["+$("#editccbbChecked").val()+"].ccbbVo.POSID");
            $("#editBRANCHID").attr("name","channelInfos["+$("#editccbbChecked").val()+"].ccbbVo.BRANCHID");
            $("#editccbbPubKey").attr("name","channelInfos["+$("#editccbbChecked").val()+"].ccbbVo.publicKey");
            $("#editUSERID").attr("name","channelInfos["+$("#editccbbChecked").val()+"].ccbbVo.USERID");
            $("#editccbbPASSWORD").attr("name","channelInfos["+$("#editccbbChecked").val()+"].ccbbVo.PASSWORD");
            $("#editport").attr("name","channelInfos["+$("#editccbbChecked").val()+"].ccbbVo.port");

            $("#editMERCHANTID").attr("required","");
            $("#editPOSID").attr("required","");
            $("#editBRANCHID").attr("required","");
            $("#editccbbPubKey").attr("required","");
            $("#editUSERID").attr("required","");
            $("#editccbbPASSWORD").attr("required","");
            $("#editport").attr("required","");
            $("#editaggregation").show();
        }else{
            $("#editMERCHANTID").removeAttr("required");
            $("#editPOSID").removeAttr("required");
            $("#editBRANCHID").removeAttr("required");
            $("#editccbbPubKey").removeAttr("required");
            $("#editUSERID").removeAttr("required");
            $("#editccbbPASSWORD").removeAttr("required");
            $("#editport").removeAttr("required");

            $("#editMERCHANTID").removeAttr("name");
            $("#editPOSID").removeAttr("name");
            $("#editBRANCHID").removeAttr("name");
            $("#editccbbPubKey").removeAttr("name");
            $("#editUSERID").removeAttr("name");
            $("#editccbbPASSWORD").removeAttr("name");
            $("#editport").removeAttr("name");
            $("#editaggregation").hide();
        }
    }

    function editcheckboxTwoclick(checkbox){
        if ( checkbox.checked == true){
            $("#editDCMERCHANTID").attr("name","channelInfos["+$("#editccbbChecked").val()+"].ccbbVo.DCMERCHANTID");
            $("#editDCPOSID").attr("name","channelInfos["+$("#editccbbChecked").val()+"].ccbbVo.DCPOSID");
            $("#editDCBRANCHID").attr("name","channelInfos["+$("#editccbbChecked").val()+"].ccbbVo.DCBRANCHID");
            $("#editccbbDCPubKey").attr("name","channelInfos["+$("#editccbbChecked").val()+"].ccbbVo.DCpublicKey");
            $("#editDCpubKey1").attr("name","channelInfos["+$("#editccbbChecked").val()+"].ccbbVo.DCpubKey1");
            $("#editDCpriKey1").attr("name","channelInfos["+$("#editccbbChecked").val()+"].ccbbVo.DCpriKey1");
            $("#editDCpubKey2").attr("name","channelInfos["+$("#editccbbChecked").val()+"].ccbbVo.DCpubKey2");
            $("#editDCFTCORPID").attr("name","channelInfos["+$("#editccbbChecked").val()+"].ccbbVo.DCFTCORPID");
            $("#editDCUSERID").attr("name","channelInfos["+$("#editccbbChecked").val()+"].ccbbVo.DCUSERID");
            $("#editDCPASSWORD").attr("name","channelInfos["+$("#editccbbChecked").val()+"].ccbbVo.DCPASSWORD");

            $("#editDCMERCHANTID").attr("required","");
            $("#editDCPOSID").attr("required","");
            $("#editDCBRANCHID").attr("required","");
            $("#editccbbDCPubKey").attr("required","");
            $("#editDCpubKey1").attr("required","");
            $("#editDCpriKey1").attr("required","");
            $("#editDCpubKey2").attr("required","");
            $("#editDCFTCORPID").attr("required","");
            $("#editDCUSERID").attr("required","");
            $("#editDCPASSWORD").attr("required","");
            $("#editDC").show();
        }else{
            $("#editDCMERCHANTID").removeAttr("required");
            $("#editDCPOSID").removeAttr("required");
            $("#editDCBRANCHID").removeAttr("required");
            $("#editccbbDCPubKey").removeAttr("required");
            $("#editDCpubKey1").removeAttr("required");
            $("#editDCpriKey1").removeAttr("required");
            $("#editDCpubKey2").removeAttr("required");
            $("#editDCFTCORPID").removeAttr("required");
            $("#editDCUSERID").removeAttr("required");
            $("#editDCPASSWORD").removeAttr("required");

            $("#editDCMERCHANTID").removeAttr("name");
            $("#editDCPOSID").removeAttr("name");
            $("#editDCBRANCHID").removeAttr("name");
            $("#editccbbDCPubKey").removeAttr("name");
            $("#editDCpubKey1").removeAttr("name");
            $("#editDCpubKey1").removeAttr("name");
            $("#editDCpubKey2").removeAttr("name");
            $("#editDCFTCORPID").removeAttr("name");
            $("#editDCUSERID").removeAttr("name");
            $("#editDCPASSWORD").removeAttr("name");
            $("#editDC").hide();
        }
    }

    function editcheckboxThreeclick(checkbox){
        if ( checkbox.checked == true){
            $("#editappidUNIONPAYPS").attr("name","channelInfos["+$("#editccbbChecked").val()+"].ccbbVo.appId");
            $("#editappkeyUNIONPAYPS").attr("name","channelInfos["+$("#editccbbChecked").val()+"].ccbbVo.appKey");
            $("#editmerchantCodeUNIONPAYPS").attr("name","channelInfos["+$("#editccbbChecked").val()+"].ccbbVo.merchantCode");
            $("#editterminalCodeUNIONPAYPS").attr("name","channelInfos["+$("#editccbbChecked").val()+"].ccbbVo.terminalCode");

            $("#editappidUNIONPAYPS").attr("required","");
            $("#editappkeyUNIONPAYPS").attr("required","");
            $("#editmerchantCodeUNIONPAYPS").attr("required","");
            $("#editterminalCodeUNIONPAYPS").attr("required","");
            $("#editUNIONPAYPS").show();
        }else {
            $("#editappidUNIONPAYPS").removeAttr("required");
            $("#editappkeyUNIONPAYPS").removeAttr("required");
            $("#editmerchantCodeUNIONPAYPS").removeAttr("required");
            $("#editterminalCodeUNIONPAYPS").removeAttr("required");

            $("#editappidUNIONPAYPS").removeAttr("name");
            $("#editappkeyUNIONPAYPS").removeAttr("name");
            $("#editmerchantCodeUNIONPAYPS").removeAttr("name");
            $("#editterminalCodeUNIONPAYPS").removeAttr("name");
            $("#editUNIONPAYPS").hide();
        }
    }
    //乐刷
    function editleshua(i) {
        $("#editleshuamerchantId").attr("name","channelInfos["+i+"].leShua.merchant_id");
        $("#editleshuaKey").attr("name","channelInfos["+i+"].leShua.key");

        $("#editleshuaTypes").attr("name","channelInfos["+i+"].payType");
        $("#editleshuaRemark").attr("name","channelInfos["+i+"].remark");

        $("#editleshuaType").attr("data-placeholder","请从列表选择一项");
        $("#editleshuaType").attr("required","");
        $("#editleshuamerchantId").attr("required","");
        $("#editleshuaKey").attr("required","");
    }
    //大华捷通
    function editchinaums(i){
        $("#editchinaumsmerchantId").attr("name","channelInfos["+i+"].chinaums.merid");
        $("#editchinaumsdevsn").attr("name","channelInfos["+i+"].chinaums.devsn");
        $("#editchinaumsKey").attr("name","channelInfos["+i+"].chinaums.key");


        $("#editchinaumsTypes").attr("name","channelInfos["+i+"].payType");
        $("#editchinaumsRemark").attr("name","channelInfos["+i+"].remark");

        $("#editchinaumsType").attr("data-placeholder","请从列表选择一项");
        $("#editchinaumsType").attr("required","");
        $("#editchinaumsmerchantId").attr("required","");
        $("#editchinaumsdevsn").attr("required","");
        $("#editchinaumsKey").attr("required","");

        $("#editchinaumsIsCallback").val(i);
    }

    //银联校园版
    function editunionschool(i){
        $("#editunionschoolBrandId").attr("name","channelInfos["+i+"].unionSchool.brand_id");
        $("#editunionschoolOpshopId").attr("name","channelInfos["+i+"].unionSchool.op_shop_id");
        $("#editunionschoolBussType").attr("name","channelInfos["+i+"].unionSchool.buss_type");
        $("#editunionschoolKey").attr("name","channelInfos["+i+"].unionSchool.key");


        $("#editunionschoolTypes").attr("name","channelInfos["+i+"].payType");
        $("#editunionschoolRemark").attr("name","channelInfos["+i+"].remark");

        $("#editunionschoolType").attr("data-placeholder","请从列表选择一项");
        $("#editunionschoolType").attr("required","");
        $("#editunionschoolBrandId").attr("required","");
        $("#editunionschoolOpshopId").attr("required","");
        $("#editunionschoolBussType").attr("required","");
        $("#editunionschoolKey").attr("required","");

        $("#editunionschoolIsCallback").val(i);
    }
    //支付宝选中那个支付方式，把对应的值赋值给隐藏的文本框
    $("#editzpaytype").change(function(){
        var reslist=$("#editzpaytype").select2("data");
        $("#editpayType2").val(payTypes(reslist));
    });

    $("#editccbbPayType").change(function(){
        var reslist=$("#editccbbPayType").select2("data");
        var payTypeString=payTypes(reslist);
        editccbbcallbackg(payTypeString);
        $("#editccbbPayTypes").val(payTypeString);
    });

    function editccbbcallbackg(payTypeString){
        if (payTypeString.substr(0,1)=="1" || payTypeString.substr(2,1)=="1"
            || payTypeString.substr(3,1)=="1"){
            $("#editccbbCallbacks").show();
            $("#editccbbCallback").attr("name","channelInfos["+$("#editccbbChecked").val()+"].ccbbVo.callbackAddress");
            $("#editccbbCallback").attr("required","");
            $("#editccbbAPPID").attr("name","channelInfos["+$("#editccbbChecked").val()+"].ccbbVo.wxappid");
            $("#editccbbAPPID").attr("required","");
        }else {
            $("#editccbbCallbacks").hide();
            $("#editccbbCallback").removeAttr("name");
            $("#editccbbCallback").removeAttr("required");
            $("#editccbbAPPID").removeAttr("name");
            $("#editccbbAPPID").removeAttr("required");
        }
    }

    //选中支付类型的文本框的值，对隐藏的文本框赋值
    $("#editcompanyId").change(function(){
        var companyName=$("#editcompanyId").find("option:selected").text();
        $("#editcompanyName").val(companyName);
    });

    $("#editicbcPayTypeselect").change(function(){
        var reslist=$("#editicbcPayTypeselect").select2("data");
        $("#editicbcPayType").val(payTypes(reslist));
    });

    $("#editunionpaytype").change(function(){
        var reslist=$("#editunionpaytype").select2("data");
        var payTypeString=payTypes(reslist);
        editunionpayCallback(payTypeString);
        $("#editpayType4").val(payTypeString);
    });

    //判断是否需要回调地址
    function editunionpayCallback(payTypeString){
        if (payTypeString.substr(0,1)=="1" || payTypeString.substr(2,1)=="1"
            || payTypeString.substr(3,1)=="1"){
            $("#editunionCallbacks").show();
            $("#editunionCallback").attr("name","payCompanyInfos["+$("#editunionIsCallback").val()+"].unionJsonPayVo.callbackAddress");
            $("#editunionCallback").attr("required","");
        }else {
            $("#editunionCallbacks").hide();
            $("#editunionCallback").removeAttr("name");
            $("#editunionCallback").removeAttr("required");
        }
    }

    $("#editqingDaoNongShangtype").change(function(){
        var reslist=$("#editqingDaoNongShangtype").select2("data");
        $("#editpayType5").val(payTypes(reslist));
    });
    $("#editShouQianBaPayType").change(function(){
        var reslist=$("#editShouQianBaPayType").select2("data");
        $("#editShouQianBaPayTypes").val(payTypes(reslist));
    });
    $("#editkancloudType").change(function(){
        var reslist=$("#editkancloudType").select2("data");
        $("#editkancloudTypes").val(payTypes(reslist));
    });
    $("#editleshuaType").change(function(){
        var reslist=$("#editleshuaType").select2("data");
        $("#editleshuaTypes").val(payTypes(reslist));
    });
    $("#editchinaumsType").change(function(){
        var reslist=$("#editchinaumsType").select2("data");
        var payTypeString=payTypes(reslist);
        editchinaumsCallback(payTypeString);
        $("#editchinaumsTypes").val(payTypeString);
    });

    //判断是否需要回调地址
    function editchinaumsCallback(payTypeString){
        if (payTypeString.substr(0,1)=="1" || payTypeString.substr(2,1)=="1"
            || payTypeString.substr(3,1)=="1"){
            $("#editchinaumsCallbacks").show();
            $("#editchinaumsCallback").attr("name","channelInfos["+$("#editchinaumsIsCallback").val()+"].chinaums.callbackAddress");
            $("#editchinaumsCallback").attr("required","");
        }else {
            $("#editchinaumsCallbacks").hide();
            $("#editchinaumsCallback").removeAttr("name");
            $("#editchinaumsCallback").removeAttr("required");
        }
    }

    $("#editunionschoolType").change(function(){
        var reslist=$("#editunionschoolType").select2("data");
        var payTypeString=payTypes(reslist);
        editunionschoolCallback(payTypeString);
        $("#editunionschoolTypes").val(payTypeString);
    });

    //判断是否需要回调地址
    function editunionschoolCallback(payTypeString){
        if (payTypeString.substr(0,1)=="1" || payTypeString.substr(2,1)=="1"
            || payTypeString.substr(3,1)=="1"){
            $("#editunionschoolCallbacks").show();
            $("#unionschoolCallback").attr("name","channelInfos["+$("#editunionschoolIsCallback").val()+"].unionSchool.callbackAddress");
            $("#unionschoolCallback").attr("required","");
        }else {
            $("#editunionschoolCallbacks").hide();
            $("#unionschoolCallback").removeAttr("name");
            $("#unionschoolCallback").removeAttr("required");
        }
    }
    function edityin() {
        $("#editWX").hide();
        $("#editZF").hide();
        $("#editICBC").hide();
        $("#editUNION").hide();
        $("#editQDNS").hide();
        $("#editShouQianBa").hide();
        $("#editkancloud").hide();
        $("#editccbb").hide();
        $("#editleshua").hide();
        $("#editchinaums").hide();
        $("#editunionschool").hide();
        $("#editUNIONPAYPS").hide();
        editremoveAttr();
    }

    //限制只能输入数字和两位小数，用于金额文本框
    function num(obj){
        obj.value = obj.value.replace(/[^\d.]/g,""); //清除"数字"和"."以外的字符
        obj.value = obj.value.replace(/^\./g,""); //验证第一个字符是数字
        obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个, 清除多余的
        obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
        obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3'); //只能输入两个小数
    }

    function payTypes(reslist){
        var all="";
        var strPaytype="000000";
        for(var i=0;i<reslist.length;i++) {
            all= reslist[i].text;
            if (all=="主扫") {
                strPaytype=replaceChat(strPaytype,0,1);
            }else if (all=="被扫") {
                strPaytype=replaceChat(strPaytype,1,1);
            }else if (all=="统一支付") {
                strPaytype=replaceChat(strPaytype,2,1);
            }
        }
        return strPaytype;
    }

    function replaceChat(source,pos,newChar){
        //source为原字符串，pos为要修改字符串的指定位置的值，newChar为要修改的值
        if(pos<0||pos>=source.length||source.length==0){
            return "0";
        }
        var iBeginPos= 0, iEndPos=source.length;
        var sFrontPart=source.substr(iBeginPos,pos);
        var sTailPart=source.substr(pos+1,source.length);
        var sRet=sFrontPart+newChar+sTailPart;
        return sRet;
    }
</script>
</html>